Qore Programming Language
1.12.0
|
provides a safe and exception-safe way to hold write locks in Qore, only to be used on the stack, cannot be dynamically allocated More...
#include <QoreRWLock.h>
Public Member Methods | |
DLLLOCAL | QoreSafeRWWriteLocker (QoreRWLock &n_l) |
creates the object and grabs the write lock | |
DLLLOCAL | QoreSafeRWWriteLocker (QoreRWLock *n_l) |
creates the object and grabs the write lock | |
DLLLOCAL | ~QoreSafeRWWriteLocker () |
destroys the object and releases the lock | |
DLLLOCAL void | lock () |
locks the object and updates the locked flag, assumes that the lock is not already held | |
DLLLOCAL void | stay_locked () |
will not unlock the lock when the destructor is run; do not use any other functions of this class after calling this function | |
DLLLOCAL void | unlock () |
unlocks the object and updates the locked flag, assumes that the lock is held | |
Private Attributes | |
QoreRWLock * | l |
the pointer to the lock that will be managed | |
bool | locked |
lock flag | |
provides a safe and exception-safe way to hold write locks in Qore, only to be used on the stack, cannot be dynamically allocated
Ensures that write locks are released by locking the write lock when the object is created and releasing it when the object is destroyed.