22 #include "mutexexceptions.h"
28 if((error=pthread_mutex_init(&this->access,NULL))!=0)
31 throw CMutexException(_HERE_,
"Impossible to create a new mutex object.\n");
39 if ((error=pthread_mutex_lock(&this->access))!=0 )
50 if ((error=pthread_mutex_trylock(&this->access))!=0 )
57 throw CMutexException(_HERE_,
"Impossible to try to enter the mutex.\n");
68 if ((error=pthread_mutex_unlock(&this->access))!=0 )
81 if((error=pthread_mutex_destroy(&this->access))!=0)
Mutual exclusion exception class.
CMutex()
default constructor
virtual ~CMutex()
default destructor
bool try_enter(void)
function to request access to the critical section and return if denied.
void exit(void)
function to release the critical section
void enter(void)
function to request access to the critical section