A readers-writer lock allowing concurrent reads or exclusive writes.
More...
|
|
| RWLock () |
| | Constructs a new RWLock with no locks held.
|
|
| ~RWLock () |
| | Destroys the RWLock.
|
| uint04 | numOfReadLocks () const |
| | Returns the total number of read locks currently held.
|
| uint04 | numOfReadLocksHeld () const |
| | Returns the number of read locks held by the calling thread.
|
| uint04 | numOfWriteLocks () const |
| | Returns the total number of write locks currently held.
|
| uint04 | numOfWriteLocksHeld () const |
| | Returns the number of write locks held by the calling thread.
|
| void | readLock () |
| | Acquires a read lock.
|
|
void | readUnlock () |
| | Releases a previously acquired read lock.
|
| bool | tryReadLock () |
| | Attempts to acquire a read lock without blocking.
|
| bool | tryReadLock (uint08 time) |
| | Attempts to acquire a read lock, waiting up to the specified time.
|
| bool | tryWriteLock () |
| | Attempts to acquire a write lock without blocking.
|
| bool | tryWriteLock (uint08 time) |
| | Attempts to acquire a write lock, waiting up to the specified time.
|
| void | writeLock () |
| | Acquires a write lock.
|
|
void | writeUnlock () |
| | Releases a previously acquired write lock.
|
|
| static RWLock * | getEntry (const void *entry) |
| | Retrieves the RWLock associated with the given pointer.
|
A readers-writer lock allowing concurrent reads or exclusive writes.
- See also
- RLock, WLock, Thread
Definition at line 48 of file RWLock.h.
◆ getEntry()
| RWLock * RWLock::getEntry |
( |
const void * | entry | ) |
|
|
static |
Retrieves the RWLock associated with the given pointer.
- Parameters
-
| [in] | entry | The pointer key to look up. |
- Returns
- A pointer to the RWLock associated with the entry.
References RWLock().
◆ numOfReadLocks()
| uint04 RWLock::numOfReadLocks |
( |
| ) |
const |
|
nodiscard |
Returns the total number of read locks currently held.
- Returns
- The total read lock count.
◆ numOfReadLocksHeld()
| uint04 RWLock::numOfReadLocksHeld |
( |
| ) |
const |
|
nodiscard |
Returns the number of read locks held by the calling thread.
- Returns
- The number of read locks held by this thread.
◆ numOfWriteLocks()
| uint04 RWLock::numOfWriteLocks |
( |
| ) |
const |
|
nodiscard |
Returns the total number of write locks currently held.
- Returns
- The total write lock count.
◆ numOfWriteLocksHeld()
| uint04 RWLock::numOfWriteLocksHeld |
( |
| ) |
const |
|
nodiscard |
Returns the number of write locks held by the calling thread.
- Returns
- The number of write locks held by this thread.
◆ readLock()
| void RWLock::readLock |
( |
| ) |
|
Acquires a read lock.
Blocks until the lock is available.
◆ tryReadLock() [1/2]
| bool RWLock::tryReadLock |
( |
| ) |
|
Attempts to acquire a read lock without blocking.
- Returns
- True if the read lock was successfully acquired, false otherwise.
◆ tryReadLock() [2/2]
| bool RWLock::tryReadLock |
( |
uint08 | time | ) |
|
Attempts to acquire a read lock, waiting up to the specified time.
- Parameters
-
| [in] | time | The maximum time in nanoseconds to wait for the lock. |
- Returns
- True if the read lock was successfully acquired within the timeout.
◆ tryWriteLock() [1/2]
| bool RWLock::tryWriteLock |
( |
| ) |
|
Attempts to acquire a write lock without blocking.
- Returns
- True if the write lock was successfully acquired, false otherwise.
◆ tryWriteLock() [2/2]
| bool RWLock::tryWriteLock |
( |
uint08 | time | ) |
|
Attempts to acquire a write lock, waiting up to the specified time.
- Parameters
-
| [in] | time | The maximum time in nanoseconds to wait for the lock. |
- Returns
- True if the write lock was successfully acquired within the timeout.
◆ writeLock()
| void RWLock::writeLock |
( |
| ) |
|
Acquires a write lock.
Blocks until the lock is available.
The documentation for this class was generated from the following file: