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