DOKK / manpages / debian 10 / libcommoncpp2-doc / ost_AtomicCounter.3.en
ost::AtomicCounter(3) Library Functions Manual ost::AtomicCounter(3)

ost::AtomicCounter - The AtomicCounter class offers thread-safe manipulation of an integer counter.

#include <thread.h>


AtomicCounter ()
Initialize an atomic counter to 0. AtomicCounter (int value)
Initialize an atomic counter to a known value. ~AtomicCounter ()
int operator++ (void)
int operator-- (void)
int operator+= (int change)
int operator-= (int change)
int operator+ (int change)
int operator- (int change)
int operator= (int value)
bool operator! (void)
operator int ()

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.

Author:

Sean Cavanaugh sean@dimensionalrift.com atomic counter operation.

Initialize an atomic counter to 0.

Initialize an atomic counter to a known value.

Parameters:

value initial value.

int ost::AtomicCounter::operator- (int change)

int ost::AtomicCounter::operator-- (void)

int ost::AtomicCounter::operator-= (int change)

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

Wed Oct 31 2018 GNU CommonC++