A guard class that acquires read access to its resource upon creation and releases it upon destruction.
More...
template<class Resource>
class RWTReadLockGuard< Resource >
RWTReadLockGuard is a guard class that acquires read access on its resource upon creation and releases it upon destruction. Guard objects work in conjunction with block statements to establish an appropriate state upon creation, maintain that state for the duration of the block, and restore the original state upon destruction. For example, a guard may acquire read access on a mutex upon creation and release it when destructed. The class used as the template parameter Resource
must be one that provides acquireRead() and release() methods, such as the synchronization classes provided in this module.
- Example
#include <rw/sync/RWReadersWriterLock.h>
#include <rw/sync/RWTReadLockGuard.h>
void foo() {
}
A synchronization lock that allows concurrent access to multiple readers, but limits access to a sing...
Definition RWReadersWriterLock.h:127
A guard class that acquires read access to its resource upon creation and releases it upon destructio...
Definition RWTReadLockGuard.h:62
- See also
- RWTTryReadLockGuard, RWTReadUnlockGuard