Protium
Math and Design Features
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Mutex.cxx
Go to the documentation of this file.
2 
3 Protium::Threads::Mutex::Mutex() : fIsLocked(false){
4  pthread_mutex_init(&fMtx, 0);
5 }
6 
8  pthread_mutex_lock(&fMtx);
9  fIsLocked = true;
10 }
11 
13  pthread_mutex_unlock(&fMtx);
14  fIsLocked = false;
15 }
16 
18  return fIsLocked;
19 }
pthread_mutex_t fMtx
Definition: Mutex.h:25
void Lock()
Attempts to lock the mutex and blocks until mutex is available.
Definition: Mutex.cxx:7
Defines mutexes and policies to be used by threaded objects.
void Unlock()
Unlocks the mutex for the next usage.
Definition: Mutex.cxx:12