19 #ifndef PAGESPEED_KERNEL_BASE_MEM_LOCK_MANAGER_H_
20 #define PAGESPEED_KERNEL_BASE_MEM_LOCK_MANAGER_H_
31 namespace net_instaweb {
43 static const int64 kNoWakeupsPending = -1;
47 virtual NamedLock* CreateNamedLock(
const StringPiece& name);
62 Timer* timer()
const {
return timer_; }
70 typedef std::map<StringPiece, MemLockState*> MemLockStateMap;
74 void AddPendingLock(
MemLock* lock);
75 void RemovePendingLock(
MemLock* lock);
81 MemLockStateMap lock_state_map_;
86 MemLockState::WakeupOrderedLockSet pending_locks_;
Non-blocking locking class.
Definition: named_lock_manager.h:31
Definition: named_lock_manager.h:82
Captures and maintains scheduling order for locks with a common name.
Definition: mem_lock_state.h:34
Definition: mem_lock.h:31
Definition: mem_lock_manager.h:41
void Wakeup()
Runs any pending events (cancels, steals) for any pending locks.
bool IsHeldInOrderedSet(MemLock *lock) const
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
int64 NextWakeupTimeMs() const