Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
net_instaweb::ThreadSystem::RWLock Class Referenceabstract

#include "thread_system.h"

Inheritance diagram for net_instaweb::ThreadSystem::RWLock:
net_instaweb::AbstractMutex net_instaweb::CheckingThreadSystem::RWLock net_instaweb::NullRWLock net_instaweb::PthreadRWLock

Public Member Functions

virtual bool ReaderTryLock () SHARED_TRYLOCK_FUNCTION(true)=0
 
virtual void ReaderLock () SHARED_LOCK_FUNCTION()=0
 Block until this Mutex is free, or shared, then acquire a share of it.
 
virtual void ReaderUnlock () UNLOCK_FUNCTION()=0
 Release a read share of this Mutex.
 
virtual void DCheckReaderLocked ()
 
- Public Member Functions inherited from net_instaweb::AbstractMutex
virtual bool TryLock () EXCLUSIVE_TRYLOCK_FUNCTION(true)=0
 Attempt to take mutex, true on success, false if held by another thread.
 
virtual void Lock () EXCLUSIVE_LOCK_FUNCTION()=0
 Block until mutex is available, then take the mutex.
 
virtual void Unlock () UNLOCK_FUNCTION()=0
 Release the mutex, permitting a blocked lock operation (if any) to proceed.
 
virtual void DCheckLocked ()
 
virtual void DCheckUnlocked ()
 

Detailed Description

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.

Member Function Documentation

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 bool net_instaweb::ThreadSystem::RWLock::ReaderTryLock ( )
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. Try to acquire a read share of this lock without blocking.

Implemented in net_instaweb::CheckingThreadSystem::RWLock, net_instaweb::NullRWLock, and net_instaweb::PthreadRWLock.


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