A guard class that acquires write access to its resource upon creation and releases it upon destruction.
More...
template<class Resource>
class RWTWriteLockGuard< Resource >
RWTWriteLockGuard is a guard class that acquires write 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 write access on a mutex when created and release it when destructed.
The class used as the actual template parameter for Resource
must provide acquireWrite
() and release
() methods, such as the synchronization classes in this module.
- Example
#include <rw/sync/RWReadersWriterLock.h>
#include <rw/sync/RWTWriteLockGuard.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 write access to its resource upon creation and releases it upon destructi...
Definition RWTWriteLockGuard.h:64
- See also
- RWTTryWriteLockGuard, RWTWriteUnlockGuard