The Mutex Counter is a counter variable which can safely be incremented or decremented by multiple threads.
More...
#include <thread.h>
List of all members.
Detailed Description
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.
Constructor & Destructor Documentation
Create and optionally name a mutex protected counter.
- Parameters:
-
id | name for mutex counter, optional for deadlock testing. |
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. |
Friends And Related Function Documentation
The documentation for this class was generated from the following file: