HDK
|
#include <SYS_AtomicInt.h>
Public Member Functions | |
SYS_AtomicInt (T value=0) | |
SYS_AtomicInt (SYS_EmptyConstructor) | |
T | exchange (T val) |
T | exchangeAdd (T val) |
T | add (T val) |
Atomically adds val to myValue, returning the new value of myValue. More... | |
void | maximum (T val) |
Atomically set myValue to the maximum of val and myValue. More... | |
void | minimum (T val) |
Atomically set myValue to the minimum of val and myValue. More... | |
T | compare_swap (T expected, T desired) |
void | store (T val, SYS_MemoryOrder order=SYS_MEMORY_ORDER_SEQ_CST) |
T | load (SYS_MemoryOrder order=SYS_MEMORY_ORDER_SEQ_CST) const |
SYS_FORCE_INLINE T | relaxedLoad () const |
SYS_FORCE_INLINE void | relaxedStore (T val) |
Definition at line 19 of file SYS_AtomicInt.h.
|
inlineexplicit |
Definition at line 22 of file SYS_AtomicInt.h.
|
inline |
An empty constructor. This will initialize the value with garbage, unless used as a static object (in which case it will be guaranteed by the C++ standard to be initialized to zero). Only use if required to be set prior to other, dependent statically initialized objects.
Definition at line 28 of file SYS_AtomicInt.h.
|
inline |
Atomically adds val to myValue, returning the new value of myValue.
Definition at line 107 of file SYS_AtomicInt.h.
|
inline |
Atomically compares (myValue == expected), and if true, replaces myValue with desired. Returns prior myValue.
Definition at line 152 of file SYS_AtomicInt.h.
|
inline |
Atomically assigns val to myValue, returning the prior value of myValue.
Definition at line 93 of file SYS_AtomicInt.h.
|
inline |
Atomically adds val to myValue, returning the prior value of myValue.
Definition at line 100 of file SYS_AtomicInt.h.
|
inline |
Definition at line 172 of file SYS_AtomicInt.h.
|
inline |
Atomically set myValue to the maximum of val and myValue.
Definition at line 114 of file SYS_AtomicInt.h.
|
inline |
Atomically set myValue to the minimum of val and myValue.
Definition at line 133 of file SYS_AtomicInt.h.
|
inline |
Forced RELAXED memory load GCC has trouble inlining so we pull the definition up here.
Definition at line 59 of file SYS_AtomicInt.h.
|
inline |
Definition at line 66 of file SYS_AtomicInt.h.
|
inline |
Next two methods intentionally not marked as volatile as this would cause &myValue to evaluate to a pointer to a volatile myValue and that has implications on MSVC2005+ beyond the C++ spec.
This shouldn't be a problem unless somebody needs a volatile instance of SYS_AtomicInt<T>.
Definition at line 165 of file SYS_AtomicInt.h.