Guard class to apply scope based mutex locking to objects. More...
#include <thread.h>
Public Member Functions | |
guard (const 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 (const void *object) |
Set guard to mutex lock a new object. | |
~guard () | |
Release mutex when guard falls out of scope. |
Guard 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 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 | ( | ) |
ucommon::Mutex::guard::guard | ( | const void * | object | ) |
void ucommon::Mutex::guard::operator= | ( | void * | pointer | ) | [inline] |
void ucommon::Mutex::guard::set | ( | const void * | object | ) |