class AtomicCounter

atomic counter operation. More...

Definition#include <thread.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members


Detailed Description

The AtomicCounter class offers thread-safe manipulation of an integer counter. These are commonly used for building thread-safe "reference" counters for C++ classes. The AtomicCounter depends on the platforms support for "atomic" integer operations, and can alternately substitute a "mutex" if no atomic support exists.

AtomicCounter ()

Initialize an atomic counter to 0.

AtomicCounter (int value)

Initialize an atomic counter to a known value.

Parameters:
initialvalue.