Kea
1.9.9-git
|
Read-Write Mutex. More...
#include <readwrite_mutex.h>
Public Member Functions | |
ReadWriteMutex () | |
Constructor. More... | |
virtual | ~ReadWriteMutex () |
Destructor. More... | |
void | readLock () |
Lock read. More... | |
void | readUnlock () |
Unlock read. More... | |
void | writeLock () |
Lock write. More... | |
void | writeUnlock () |
Unlock write. More... | |
Static Public Attributes | |
static const unsigned | MAX_READERS = ~WRITE_ENTERED |
The maximum number of readers (flag complement so 2^31 - 1). More... | |
static const unsigned | WRITE_ENTERED |
Constants. More... | |
Read-Write Mutex.
The code is based on Howard Hinnant's reference implementation for C++17 shared_mutex.
Definition at line 29 of file readwrite_mutex.h.
|
inline |
Constructor.
Definition at line 42 of file readwrite_mutex.h.
|
inlinevirtual |
Destructor.
Definition at line 49 of file readwrite_mutex.h.
|
inline |
Lock read.
Definition at line 74 of file readwrite_mutex.h.
Referenced by isc::util::ReadLockGuard::ReadLockGuard().
|
inline |
Unlock read.
Definition at line 84 of file readwrite_mutex.h.
Referenced by isc::util::ReadLockGuard::~ReadLockGuard().
|
inline |
Lock write.
Definition at line 54 of file readwrite_mutex.h.
References WRITE_ENTERED.
Referenced by isc::util::WriteLockGuard::WriteLockGuard().
|
inline |
Unlock write.
Definition at line 66 of file readwrite_mutex.h.
Referenced by isc::util::WriteLockGuard::~WriteLockGuard().
|
static |
The maximum number of readers (flag complement so 2^31 - 1).
Definition at line 39 of file readwrite_mutex.h.
|
static |
Constants.
The write entered flag (higher bit so 2^31).
Definition at line 35 of file readwrite_mutex.h.
Referenced by writeLock().