Page Speed Optimization Libraries
1.3.25.1
|
#include "checking_thread_system.h"
Public Member Functions | |
RWLock (ThreadSystem::RWLock *lock) | |
virtual bool | TryLock () |
Attempt to take mutex, true on success, false if held by another thread. | |
virtual void | Lock () |
Block until mutex is available, then take the mutex. | |
virtual void | Unlock () |
Release the mutex, permitting a blocked lock operation (if any) to proceed. | |
virtual bool | ReaderTryLock () |
virtual void | ReaderLock () |
Block until this Mutex is free, or shared, then acquire a share of it. | |
virtual void | ReaderUnlock () |
Release a read share of this Mutex. | |
virtual void | DCheckLocked () |
This implementation of DCheckLocked CHECK-fails if lock is not held. | |
virtual void | DCheckReaderLocked () |
We also expose CheckingThreadSystem::RWLock, which wraps a RWLock to provide read/write capable locks. This class can be used to wrap unchecked mutexes provided by other CheckingThreadSystems.
virtual void net_instaweb::CheckingThreadSystem::RWLock::DCheckReaderLocked | ( | ) | [virtual] |
Optionally checks that reader lock is held (for invariant checking purposes). Default implementation does no checking.
Reimplemented from net_instaweb::ThreadSystem::RWLock.
virtual bool net_instaweb::CheckingThreadSystem::RWLock::ReaderTryLock | ( | ) | [virtual] |
ReaderLock/Unlock are different from normal locks. Reader locks are shared while normal locks are exclusive. Normal lock cannot happen when reader has a lock. Try to acquire a read share of this lock without blocking.
Implements net_instaweb::ThreadSystem::RWLock.