Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

ost::MutexCounter Class Reference

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

#include <thread.h>

Inheritance diagram for ost::MutexCounter:

ost::Mutex List of all members.

Public Member Functions

 MutexCounter (const char *id=NULL)
 Create and optionally name a mutex protected counter.

 MutexCounter (int initial, const char *id=NULL)
 Create and optionally name a mutex protected counter with an initial value.


Friends

__EXPORT int operator++ (MutexCounter &mc)
__EXPORT int operator-- (MutexCounter &mc)

Detailed Description

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

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>


Constructor & Destructor Documentation

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.


Friends And Related Function Documentation

__EXPORT int operator++ MutexCounter mc  )  [friend]
 

__EXPORT int operator-- MutexCounter mc  )  [friend]
 


The documentation for this class was generated from the following file:
Generated on Sun Mar 21 21:43:16 2010 for GNU CommonC++ by doxygen 1.3.5