The AtomicCounter class offers thread-safe manipulation of an integer counter.
More...
#include <thread.h>
Collaboration diagram for AtomicCounter:
Public Member Functions
Initialize an atomic counter to 0.
More...
Initialize an atomic counter to a known value.
More...
Private Attributes
Detailed Description
Constructor & Destructor Documentation
AtomicCounter::AtomicCounter
(
)
Initialize an atomic counter to 0.
AtomicCounter::AtomicCounter
(
int
value )
Initialize an atomic counter to a known value.
- Parameters
-
value initial value.
AtomicCounter::~AtomicCounter
(
)
Member Function Documentation
AtomicCounter::operator int
(
)
bool AtomicCounter::operator!
(
void
)
int AtomicCounter::operator+
(
int
change )
int AtomicCounter::operator++
(
void
)
int AtomicCounter::operator+=
(
int
change )
int AtomicCounter::operator-
(
int
change )
int AtomicCounter::operator--
(
void
)
int AtomicCounter::operator-=
(
int
change )
int AtomicCounter::operator=
(
int
value )
Field Documentation
pthread_mutex_t AtomicCounter::_mutex
private
volatile int AtomicCounter::counter
private
The documentation for this class was generated from the following file: