#include <thread.h>
Public Member Functions | |
guard_writer (void *object) | |
Construct a guard for a specific object. | |
guard_writer () | |
Create an unitialized instance of guard. | |
void | operator= (void *pointer) |
Set guard to read lock a new object. | |
void | release (void) |
Prematurely release a guard. | |
void | set (void *object) |
Set guard to mutex lock a new object. | |
~guard_writer () | |
Release mutex when guard falls out of scope. |
The rwlock is located from the rwlock pool rather than contained in the target object, and the write lock is released when the guard object falls out of scope. This is essentially an automation mechanism for mutex::writer.
Definition at line 567 of file thread.h.
ucommon::ThreadLock::guard_writer::guard_writer | ( | ) |
Create an unitialized instance of guard.
Usually used with a guard = operator.
ucommon::ThreadLock::guard_writer::guard_writer | ( | void * | object | ) |
Construct a guard for a specific object.
object | to guard. |
void ucommon::ThreadLock::guard_writer::operator= | ( | void * | pointer | ) | [inline] |
void ucommon::ThreadLock::guard_writer::set | ( | void * | object | ) |
Set guard to mutex lock a new object.
If a lock is currently held, it is released.
object | to guard. |