#include <Mutex.h++>


Public Member Functions | |
| Mutex (bool recursive=false) throw () | |
| Construct a new Mutex. | |
| ~Mutex () throw () | |
| Destructor. | |
| void | lock () throw () |
| Lock the mutex, blocking until the lock is acquired. | |
| bool | tryLock (uint_t timeout=0) throw () |
| Try to lock the mutex, returning if it could not be acquired within the given amount of time. | |
| void | unlock () throw () |
| Unlock the mutex. | |
| bool | isRecursive () const throw () |
| Determine if this mutex is recursive. | |
Static Public Member Functions | |
| static bool | supportsTimedLocks () throw () |
| Determine if the host system supports timed mutex locks. | |
Protected Attributes | |
| pthread_mutex_t | _mutex |
Friends | |
| class | CondVar |
| Mutex | ( | bool | recursive = false |
) | throw () |
Construct a new Mutex.
| recursive | A flag indicating whether the mutex will be recursive. A recursive mutex can be re-entered by a thread that already holds the mutex. |
| ~Mutex | ( | ) | throw () |
Destructor.
Note that destroying a locked mutex could lead to deadlock.
| bool isRecursive | ( | ) | const throw () [inline] |
Determine if this mutex is recursive.
| void lock | ( | ) | throw () [virtual] |
| bool supportsTimedLocks | ( | ) | throw () [static] |
Determine if the host system supports timed mutex locks.
| bool tryLock | ( | uint_t | timeout = 0 |
) | throw () |
Try to lock the mutex, returning if it could not be acquired within the given amount of time.
On platforms that do not support timed mutex locks, the method returns immediately if the lock could not be acquired. On some platforms (notably Linux), recursive mutexes do not support timed locks; on these platforms, tryLock() behaves identically to lock() when applied to a recursive mutex.
| timeout | The timeout, in milliseconds. |
| void unlock | ( | ) | throw () [virtual] |
friend class CondVar [friend] |
pthread_mutex_t _mutex [protected] |
1.5.9