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