SCIRun
5.0
|
#include <AtomicCounter.h>
Public Member Functions | |
AtomicCounter (const char *name) | |
AtomicCounter (const char *name, int value) | |
~AtomicCounter () | |
Destroy the atomic counter. More... | |
operator int () const | |
int | operator++ () |
int | operator++ (int) |
Increment the counter and return the old value. More... | |
int | operator-- () |
int | operator-- (int) |
Decrement the counter and return the old value. More... | |
void | set (int) |
Set the counter to a new value. More... | |
AtomicCounter | ( | const char * | name | ) |
Create an atomic counter with an unspecified initial value. name
should be a static string which describes the primitive for debugging purposes.
AtomicCounter | ( | const char * | name, |
int | value | ||
) |
Create an atomic counter with an initial value. name should be a static string which describes the primitive for debugging purposes.
~AtomicCounter | ( | ) |
Destroy the atomic counter.
operator int | ( | ) | const |
Allows the atomic counter to be used in expressions like a normal integer. Note that multiple calls to this function may return different values if other threads are manipulating the counter.
int operator++ | ( | ) |
Increment the counter and return the new value. This does not return AtomicCounter& like a normal ++ operator would, because it would destroy atomicity
int operator++ | ( | int | ) |
Increment the counter and return the old value.
int operator-- | ( | ) |
Decrement the counter and return the new value This does not return AtomicCounter& like a normal – operator would, because it would destroy atomicity
int operator-- | ( | int | ) |
Decrement the counter and return the old value.
void set | ( | int | v | ) |
Set the counter to a new value.