Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Friends | List of all members
net_instaweb::MemLockManager Class Reference

#include "mem_lock_manager.h"

Inheritance diagram for net_instaweb::MemLockManager:
net_instaweb::NamedLockManager

Public Member Functions

 MemLockManager (Timer *timer)
 
virtual NamedLockCreateNamedLock (const StringPiece &name)
 
int64 NextWakeupTimeMs () const
 
void Wakeup ()
 Runs any pending events (cancels, steals) for any pending locks.
 
Timertimer () const
 
bool IsHeldInOrderedSet (MemLock *lock) const
 

Static Public Attributes

static const int64 kNoWakeupsPending = -1
 

Friends

class MemLockState
 

Detailed Description

Implements NamedLockManager using in-memory data structures. This core structure has two anticipated uses:

  1. A threadsafe version integrated with the Scheduler, which will establish new alarms, potentially cancelling old ones, when new locks are requested that cannot be immediately granted.
  2. An RPC-server based version where these timeouts will be fed to epoll or similar.

Member Function Documentation

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.


The documentation for this class was generated from the following file: