MADNESS
version 0.9
|
An integer with atomic set, get, read+inc, read+dec, dec+test operations. More...
#include <atomicint.h>
Public Member Functions | |
operator int () const volatile | |
Returns the value of the counter with fence ensuring subsequent operations are not moved before the load. More... | |
int | operator= (int other) |
Sets the value of the counter with fence ensuring preceding operations are not moved after the store. More... | |
AtomicInt & | operator= (const AtomicInt &other) |
Sets the value of the counter with fences ensuring operations are not moved either side of the load+store. More... | |
int | operator-- (int) |
Decrements the counter and returns the original value. More... | |
int | operator-- () |
Decrements the counter and returns the incremented value. More... | |
int | operator++ (int) |
Increments the counter and returns the original value. More... | |
int | operator++ () |
Increments the counter and returns the incremented value. More... | |
int | operator+= (const int value) |
Add value and returns the new value. More... | |
int | operator-= (const int value) |
Subtract value and returns the new value. More... | |
bool | dec_and_test () |
Decrements the counter and returns true if the new value is zero. More... | |
An integer with atomic set, get, read+inc, read+dec, dec+test operations.
Only the default constructor is available and IT DOES NOT INITIALIZE THE VARIABLE.
Conciously modeled after the TBB API to prepare for switching to it.
|
inline |
Decrements the counter and returns true if the new value is zero.
Referenced by madness::Barrier::enter(), madness::detail::RemoteCounterBase::release(), madness::tr1::shptr::detail::sp_counted_base::release(), and madness::tr1::shptr::detail::sp_counted_base::weak_release().
|
inline |
Returns the value of the counter with fence ensuring subsequent operations are not moved before the load.
|
inline |
Increments the counter and returns the original value.
|
inline |
Increments the counter and returns the incremented value.
|
inline |
Add value
and returns the new value.
|
inline |
Decrements the counter and returns the original value.
|
inline |
Decrements the counter and returns the incremented value.
|
inline |
Subtract value
and returns the new value.
|
inline |
Sets the value of the counter with fence ensuring preceding operations are not moved after the store.
Sets the value of the counter with fences ensuring operations are not moved either side of the load+store.