vrecko
virtual reality framework
|
Base class for multi-thread access to a single variable. More...
#include <MTLock.h>
Public Member Functions | |
MTLock () | |
~MTLock () | |
bool | lock () |
void | unlock () |
HANDLE | getHandle () const |
Protected Attributes | |
pthread_mutex_t * | mutex |
Base class for multi-thread access to a single variable.
After locking, the given thread can be sure that no other thread can lock the same MTLock. After performing the exclusive operation (accessing the variable etc.), the thread which issued the lock must unlock it again.
MTLOCK_IMP_EXP vrecko::MTLock::MTLock | ( | ) |
MTLOCK_IMP_EXP vrecko::MTLock::~MTLock | ( | ) |
|
inline |
Really a lower- level method, you don't need it usually.
MTLOCK_IMP_EXP bool vrecko::MTLock::lock | ( | ) |
MTLOCK_IMP_EXP void vrecko::MTLock::unlock | ( | ) |
|
protected |