#include <Mutex.h>
Inheritance diagram for util::Mutex:

Concurrent threads that must synchronize their access to shared variables need to use a mutex lock to prevent mixups.
Public Methods | |
| Mutex (int type=PTHREAD_MUTEX_RECURSIVE) throw (MutexException&) | |
| Create a new mutual exclusion lock. | |
| Mutex (const Mutex &other) | |
| Create a copy of a mutex. | |
| ~Mutex () | |
| void | lock (void) throw (MutexException&) |
| Lock a mutex. | |
| void | tryToLock (void) throw (MutexException&) |
| Lock a mutex. | |
| void | unlock (void) throw (MutexException&) |
| Release the mutex. | |
| Mutex & | operator= (const Mutex &other) |
| Copy a mutex. | |
|
|
Create a new mutual exclusion lock. The type of the mutex can be one of the predefined constants in pthread.h, i.e. PTHREAD_MUTEX_{NORMAL,RECURSIVE,ERRORCHECK,DEFAULT}. See the unix man page "pthread_mutex_settype" for details. |
|
|
Lock a mutex. When a mutex is locked by a thread, a locking attempt by another thread cannot succeed until the lock is released. This method blocks until the mutex is available.
|
|
|
Lock a mutex. This method is identical to lock except that the call terminates immediately if the mutex is alredy locked.
|
|
|
Release the mutex.
|