The Mutex Counter is a counter variable which can safely be incremented or decremented by multiple threads.
More...
#include <thread.h>
|
| MutexCounter (const char *id=NULL) |
| Create and optionally name a mutex protected counter. More...
|
|
| MutexCounter (int initial, const char *id=NULL) |
| Create and optionally name a mutex protected counter with an initial value. More...
|
|
| Mutex (const char *name=NULL) |
| The mutex is always initialized as a recursive entity. More...
|
|
virtual | ~Mutex () |
| Destroying the mutex removes any system resources associated with it. More...
|
|
void | nameMutex (const char *name) |
| Enable setting of mutex name for deadlock debug. More...
|
|
void | enterMutex (void) |
| Entering a Mutex locks the mutex for the current thread. More...
|
|
void | enter (void) |
| Future abi will use enter/leave/test members. More...
|
|
void | leave (void) |
| Future abi will use enter/leave/test members. More...
|
|
bool | test (void) |
| Future abi will use enter/leave/test members. More...
|
|
bool | tryEnterMutex (void) |
| Tries to lock the mutex for the current thread. More...
|
|
void | leaveMutex (void) |
| Leaving a mutex frees that mutex for use by another thread. More...
|
|
|
static void | setDebug (bool mode) |
| Enable or disable deadlock debugging. More...
|
|
The Mutex Counter is a counter variable which can safely be incremented or decremented by multiple threads.
A Mutex is used to protect access to the counter variable (an integer). An initial value can be specified for the counter, and it can be manipulated with the ++ and – operators.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m Thread protected integer counter.
ost::MutexCounter::MutexCounter |
( |
const char * |
id = NULL | ) |
|
Create and optionally name a mutex protected counter.
- Parameters
-
id | name for mutex counter, optional for deadlock testing. |
ost::MutexCounter::MutexCounter |
( |
int |
initial, |
|
|
const char * |
id = NULL |
|
) |
| |
Create and optionally name a mutex protected counter with an initial value.
- Parameters
-
initial | value of counter. |
id | name of counter, optional for deadlock testing. |
The documentation for this class was generated from the following file: