#include "thread_system.h"
Public Member Functions | |
virtual void | ReaderLock ()=0 |
virtual void | ReaderUnlock ()=0 |
Release a read share of this Mutex. | |
virtual void | DCheckReaderLocked () |
Interface for a Mutex with ReaderLocks(). It is possible for multiple Readers to simultaneously hold an RWLock. A reader cannot hold the lock at the same time as a Writer, nor can two Writers hold the lock.
virtual void net_instaweb::ThreadSystem::RWLock::DCheckReaderLocked | ( | ) | [virtual] |
Optionally checks that reader lock is held (for invariant checking purposes). Default implementation does no checking.
Reimplemented in net_instaweb::CheckingThreadSystem::RWLock, and net_instaweb::NullRWLock.
virtual void net_instaweb::ThreadSystem::RWLock::ReaderLock | ( | ) | [pure 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. Block until this Mutex is free, or shared, then acquire a share of it.
Implemented in net_instaweb::CheckingThreadSystem::RWLock, net_instaweb::NullRWLock, and net_instaweb::PthreadRWLock.