#include <mutex.H>
Public Member Functions | |
void | enter () |
enter the critical section (it is also allowed to enter when already inside) | |
bool | try_enter () |
try to enter the critical section and return result | |
void | leave () |
leave the critical section (it is also allowed to leave without being inside) | |
CCriticalSection (CCriticalSection::Mutex &crit_sect_mutex, const bool enter_now=true) | |
constructor: attach mutex to handle critical sections, also (by default): enter the critical section | |
~CCriticalSection () | |
destructor: if we were inside the critical section: leave the critical section | |
Private Attributes | |
Mutex & | mutex |
bool | inside |
Classes | |
class | Mutex |
It is also a good idea to use this class in conjunction with exception handling, because the traditional way of locking and unlocking a mutex may introduce severe problems, if exceptions are thrown and the state of a mutex is left undefined. (Destructors are called regardless whether the block is left with or without a throwing an exception, so the state of the mutex remains always well defined.)
Definition at line 154 of file mutex.H.
CCriticalSection::CCriticalSection | ( | CCriticalSection::Mutex & | crit_sect_mutex, | |
const bool | enter_now = true | |||
) | [inline] |
CCriticalSection::~CCriticalSection | ( | ) | [inline] |
void CCriticalSection::enter | ( | ) | [inline] |
enter the critical section (it is also allowed to enter when already inside)
Definition at line 169 of file mutex.H.
Referenced by StaticRelations::insert(), and Cprocess_clients::process_data_stream().
bool CCriticalSection::try_enter | ( | ) | [inline] |
try to enter the critical section and return result
Definition at line 179 of file mutex.H.
Referenced by StaticRelations::insert(), Cprocess_clients::process_data_stream(), and Cprocess_clients::seek_emergency_handler().
void CCriticalSection::leave | ( | ) | [inline] |
leave the critical section (it is also allowed to leave without being inside)
Definition at line 189 of file mutex.H.
Referenced by StaticRelations::insert(), Cprocess_clients::process_data_stream(), and Cprocess_clients::seek_emergency_handler().
Mutex& CCriticalSection::mutex [private] |
bool CCriticalSection::inside [private] |