|
AndroMeta
2.0.0
|
Thread sychronization convenience construct for use with MMutex. More...
#include <MGuard.h>
Public Member Functions | |
| MGuard (MMutex &mutex) | |
| MGuard (MMutex *mutex) | |
| ~MGuard () | |
| void | release () |
| void | acquire () |
| bool | tryAcquire () |
Thread sychronization convenience construct for use with MMutex.
MGuard provides a convenient mechanism for working with critical sections. Upon creation, the guard locks its associated mutex and releases it when it is destroyed. This can be particularly useful for long critical sections with multiple exit points.
| Meta::MGuard::MGuard | ( | MMutex & | mutex | ) |
Constructor.
| mutex | The associated mutex. |
| Meta::MGuard::MGuard | ( | MMutex * | mutex | ) |
Constructor.
| mutex | Pointer to the associated mutex. |
Destructor.
| void Meta::MGuard::acquire | ( | ) |
Explicitly acquire the associated mutex.
| void Meta::MGuard::release | ( | ) |
Explcitly release the associated mutex.
| bool Meta::MGuard::tryAcquire | ( | ) |
Explicitly attept to acquire the associated mutex.
1.7.6.1