Poster of Linux kernelThe best gift for a Linux geek
ost::MutexCounter

ost::MutexCounter

Section: C Library Functions (3) Updated: 16 Feb 2010
Local index Up
 

NAME

ost::MutexCounter -

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

 

SYNOPSIS


#include <thread.h>

Inherits ost::Mutex.  

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


int operator++ (MutexCounter &mc)

int operator-- (MutexCounter &mc)
 

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.

 

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

 

int operator++ (MutexCounter & mc) [friend]

 

int operator-- (MutexCounter & mc) [friend]

 

Author

Generated automatically by Doxygen for GNU CommonC++ from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Friends
Detailed Description
Constructor & Destructor Documentation
ost::MutexCounter::MutexCounter (const char * id = NULL)
ost::MutexCounter::MutexCounter (int initial, const char * id = NULL)
Friends And Related Function Documentation
int operator++ (MutexCounter & mc) [friend]
int operator-- (MutexCounter & mc) [friend]
Author

This document was created by man2html, using the manual pages.
Time: 21:51:51 GMT, April 16, 2011