Page Speed Optimization Libraries
1.13.35.1
|
#include "split_statistics.h"
Public Member Functions | |
SplitUpDownCounter (UpDownCounter *rw, UpDownCounter *w) | |
virtual void | Set (int64 new_value) |
virtual int64 | SetReturningPreviousValue (int64 new_value) |
virtual int64 | Get () const |
virtual StringPiece | GetName () const |
virtual int64 | AddHelper (int64 delta) |
This is virtual so that subclasses can add platform-specific atomicity. | |
Public Member Functions inherited from net_instaweb::UpDownCounter | |
void | Clear () |
int64 | Add (int64 delta) |
Additional Inherited Members |
A statistics variable that forwards writes to two other Variable objects, but reads only from one.
net_instaweb::SplitUpDownCounter::SplitUpDownCounter | ( | UpDownCounter * | rw, |
UpDownCounter * | w | ||
) |
UpDownCounter 'rw' will be used to read and write, variable 'w' will be used for writes only. Does not take ownership of either 'rw' or 'w'. 'rw' and 'w' must be non-NULL.
|
virtual |
Return some name representing the variable, provided that the specific implementation has some sensible way of doing so.
Implements net_instaweb::UpDownCounter.
|
virtual |
Sets the specified value, returning the previous value. This can be used to by two competing threads/processes to determine which thread modified the value first. The default implementation is non-atomic, but implementations can override to provide an atomic version.
Non-atomic implementations may result in multiple concurrent updates each returning the old value. In an atomic implementation, only one concurrent update will return the old value.
Reimplemented from net_instaweb::UpDownCounter.