Read/write lock support.
More...
#include <yateclass.h>
Read/write lock support.
A read/write lock
◆ RWLock() [1/2]
RWLock |
( |
const char * | name = 0 | ) |
|
Build a read/write lock
- Parameters
-
◆ RWLock() [2/2]
Copy constructor, creates a RWLock semaphore
- Parameters
-
original | Reference of the semaphore to share |
◆ ~RWLock()
◆ disableRWLock()
static void disableRWLock |
( |
bool | disable | ) |
|
|
static |
Debugging method for disabling RW locks usage and replacing it with a non-recursive mutex
- Parameters
-
disable | True to disable RW locks usage |
◆ lock()
virtual bool lock |
( |
long | maxWait = -1 | ) |
|
|
inlinevirtual |
Lock the write lock. This behaves like a mutex
- Parameters
-
maxWait | Time to wait for locking to succeed, -1 to wait forever, 0 return immediately |
- Returns
- True if locking succeed
Implements Lockable.
◆ lockableRWLock()
virtual RWLock * lockableRWLock |
( |
| ) |
|
|
inlinevirtual |
◆ locked()
virtual bool locked |
( |
| ) |
const |
|
virtual |
Check if the object is currently locked - as it's asynchronous it guarantees nothing if other thread changes the status
- Returns
- True if the object was locked when the function was called
Implements Lockable.
◆ readLock()
bool readLock |
( |
long | maxWait = -1 | ) |
|
◆ unlock()
Unlock either the read or write lock held by the calling thread
- Returns
- True if anything was unlocked
Implements Lockable.
◆ writeLock()
bool writeLock |
( |
long | maxWait = -1 | ) |
|
The documentation for this class was generated from the following file: