|
The Pedigree Project 0.1
|
#include <UnlikelyLock.h>
Collaboration diagram for UnlikelyLock:Public Member Functions | |
| void | enter () |
| void | leave () |
| void | acquire () |
| void | release () |
Private Attributes | |
| Mutex | m_Lock |
| ConditionVariable | m_Condition |
| uint64_t | m_nReaders |
| uint64_t | m_nWaitingWriters |
| bool | m_bActiveWriter |
A reader/writer lock optimised for the case where exclusive access is rare.
Admission waits internally until ownership is available. Signal delivery remains visible to the outer operation, but cannot make a caller retry and accidentally lose the interruption or bypass lock ownership.
Definition at line 41 of file UnlikelyLock.h.
| UnlikelyLock::UnlikelyLock | ( | ) |
Definition at line 24 of file UnlikelyLock.cc.
| UnlikelyLock::~UnlikelyLock | ( | ) |
Definition at line 27 of file UnlikelyLock.cc.
| void UnlikelyLock::acquire | ( | ) |
Locks the lock. Will not return until all other threads have exited the critical region.
Definition at line 55 of file UnlikelyLock.cc.
References ConditionVariable::waitForCompletion().
Referenced by PosixSubsystem::acquire(), FatFilesystem::getClusterEntry(), PosixSubsystem::getSignalDisposition(), PosixSubsystem::PosixSubsystem(), PosixSubsystem::queueSignalDelivery(), PosixSubsystem::resetSignalHandlersForExec(), FatFilesystem::setClusterEntry(), and PosixSubsystem::setSignalHandler().
Here is the caller graph for this function:| void UnlikelyLock::enter | ( | ) |
Enters the critical section after all active writers have left.
Definition at line 34 of file UnlikelyLock.cc.
References ConditionVariable::waitForCompletion().
Referenced by PosixSubsystem::getSignalDisposition(), and PosixSubsystem::PosixSubsystem().
Here is the caller graph for this function:| void UnlikelyLock::leave | ( | ) |
Leaving the critical section.
Definition at line 43 of file UnlikelyLock.cc.
References ConditionVariable::broadcast().
Referenced by PosixSubsystem::getSignalDisposition(), and PosixSubsystem::PosixSubsystem().
Here is the caller graph for this function:| void UnlikelyLock::release | ( | ) |
Releases the lock.
Definition at line 66 of file UnlikelyLock.cc.
References ConditionVariable::broadcast().
Referenced by FatFilesystem::getClusterEntry(), PosixSubsystem::getSignalDisposition(), PosixSubsystem::PosixSubsystem(), PosixSubsystem::queueSignalDelivery(), PosixSubsystem::release(), PosixSubsystem::resetSignalHandlersForExec(), FatFilesystem::setClusterEntry(), and PosixSubsystem::setSignalHandler().
Here is the caller graph for this function:
|
private |
Definition at line 65 of file UnlikelyLock.h.
|
private |
Definition at line 61 of file UnlikelyLock.h.
|
private |
Definition at line 60 of file UnlikelyLock.h.
|
private |
Definition at line 63 of file UnlikelyLock.h.
|
private |
Definition at line 64 of file UnlikelyLock.h.