A guard class that releases its resource upon creation and acquires read access to its resource upon destruction.
More...
template<class Resource>
class RWTWriteUnlockGuard< Resource >
RWTWriteUnlockGuard is a guard class that releases its resource upon creation and acquires write access on its resource 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 release write access on a mutex when created and reacquire write access on that mutex 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/RWTWriteUnlockGuard.h>
void foo()
{
{
}
}
- See also
- RWTWriteLockGuard