vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::MTLock Class Reference

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
 

Detailed Description

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.

Author
Vit Kovalcik
Date
2011

Constructor & Destructor Documentation

MTLOCK_IMP_EXP vrecko::MTLock::MTLock ( )
MTLOCK_IMP_EXP vrecko::MTLock::~MTLock ( )

Member Function Documentation

HANDLE vrecko::MTLock::getHandle ( ) const
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 ( )

Member Data Documentation

pthread_mutex_t* vrecko::MTLock::mutex
protected

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