ost::MutexCounter Class Reference

The Mutex Counter is a counter variable which can safely be incremented or decremented by multiple threads. More...

#include <thread.h>

Inherits ost::Mutex.

Public Member Functions

 MutexCounter (int initial)
 Create and optionally name a mutex protected counter with an initial value.
 MutexCounter ()
 Create and optionally name a mutex protected counter.
int operator++ ()
int operator-- ()

Protected Attributes

volatile int counter

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@ostel.com> Thread protected integer counter.

Definition at line 93 of file thread.h.


Constructor & Destructor Documentation

ost::MutexCounter::MutexCounter ( int  initial  ) 

Create and optionally name a mutex protected counter with an initial value.

Parameters:
initial value of counter.

The documentation for this class was generated from the following file:

Generated on 24 Sep 2014 for ucommon by  doxygen 1.6.1