---
name: "MutexCounter"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/MutexCounter"
---

# MutexCounter(3cc)

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

## NAME

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

## SYNOPSIS

`#include <thread.h>`

Inherits **Mutex**.

### Public Methods

**MutexCounter** ()\
 **MutexCounter** (int initial)\
 friend **CCXX\_EXPORT** (int) operator++(MutexCounter &mc)\
 friend **CCXX\_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

### MutexCounter::MutexCounter ()

### MutexCounter::MutexCounter (int initial)

## MEMBER FUNCTION DOCUMENTATION

### MutexCounter::CCXX\_EXPORT (int)

### MutexCounter::CCXX\_EXPORT (int)

## AUTHOR

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