Page Speed Optimization Libraries
1.13.35.1
|
#include "mem_lock_manager.h"
Public Member Functions | |
MemLockManager (Timer *timer) | |
virtual NamedLock * | CreateNamedLock (const StringPiece &name) |
int64 | NextWakeupTimeMs () const |
void | Wakeup () |
Runs any pending events (cancels, steals) for any pending locks. | |
Timer * | timer () const |
bool | IsHeldInOrderedSet (MemLock *lock) const |
Static Public Attributes | |
static const int64 | kNoWakeupsPending = -1 |
Friends | |
class | MemLockState |
Implements NamedLockManager using in-memory data structures. This core structure has two anticipated uses:
bool net_instaweb::MemLockManager::IsHeldInOrderedSet | ( | MemLock * | lock | ) | const |
Method to determine whether this lock is in pending_locks_. This is used for debug-assertions to ensure we don't mutate ordering fields in locks that are held in sets.
int64 net_instaweb::MemLockManager::NextWakeupTimeMs | ( | ) | const |
Returns the absolute time (ms since 1970) of the next interesting event (cancel, steal) for any lock created with this manager. Returns kNoWakeupsPending if no wakeups are needed.
Note that the wakeup time may change as a result of new locks being requested or released. Depending on the scheduling technology used (e.g. epoll, Scheduler, etc) explicit support might be needed to ensure a timely wakeup.