Qore Programming Language - C/C++ Library 2.2.1
Loading...
Searching...
No Matches
QoreSafeRWReadLocker Class Reference

provides a safe and exception-safe way to hold read locks in Qore, only to be used on the stack, cannot be dynamically allocated More...

#include <QoreRWLock.h>

Collaboration diagram for QoreSafeRWReadLocker:
[legend]

Public Member Functions

DLLLOCAL QoreSafeRWReadLocker ()
 creates an empty object
DLLLOCAL QoreSafeRWReadLocker (QoreRWLock &n_l)
 creates the object and grabs the read lock
DLLLOCAL QoreSafeRWReadLocker (QoreRWLock *n_l)
 creates the object and grabs the read lock
DLLLOCAL ~QoreSafeRWReadLocker ()
 destroys the object and releases the lock
DLLLOCAL void handoffTo (QoreRWLock &n)
 Handoff to another read 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

Protected Attributes

QoreRWLockl
 the pointer to the lock that will be managed
bool locked
 lock flag

Detailed Description

provides a safe and exception-safe way to hold read locks in Qore, only to be used on the stack, cannot be dynamically allocated

Ensures that read locks are released by locking the read lock when the object is created and releasing it when the object is destroyed.

See also
QoreSafeRWWriteLocker

The documentation for this class was generated from the following file: