#include <UMutex.h>
Public Member Functions | |
int | lock () const |
int | lockTry () const |
UMutex () | |
int | unlock () const |
virtual | ~UMutex () |
Private Member Functions | |
void | operator= (UMutex &) |
UMutex (const UMutex &) | |
Private Attributes | |
pthread_mutex_t | M |
A mutex class.
On a lock() call, the calling thread is blocked if the UMutex was previously locked by another thread. It is unblocked when unlock() is called.
On Unix (not yet tested on Windows), UMutex is recursive: the same thread can call multiple times lock() without being blocked.
Example: