AndroMeta  2.0.0
Public Member Functions
Meta::MGuard Class Reference

Thread sychronization convenience construct for use with MMutex. More...

#include <MGuard.h>

List of all members.

Public Member Functions

 MGuard (MMutex &mutex)
 MGuard (MMutex *mutex)
 ~MGuard ()
void release ()
void acquire ()
bool tryAcquire ()

Detailed Description

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.


Constructor & Destructor Documentation

Constructor.

Parameters:
mutexThe associated mutex.

Constructor.

Parameters:
mutexPointer to the associated mutex.

Destructor.


Member Function Documentation

Explicitly acquire the associated mutex.

Explcitly release the associated mutex.

Explicitly attept to acquire the associated mutex.

Returns:
true on success.

The documentation for this class was generated from the following file: