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... | |
T | maximum (T val) |
T | minimum (T val) |
T | compare_swap (T expected, T desired) |
bool | compareExchangeStrong (T &expected, T desired, SYS_MemoryOrder success=SYS_MEMORY_ORDER_SEQ_CST, SYS_MemoryOrder failure=SYS_MEMORY_ORDER_SEQ_CST) |
bool | compareExchangeWeak (T &expected, T desired, SYS_MemoryOrder success=SYS_MEMORY_ORDER_SEQ_CST, SYS_MemoryOrder failure=SYS_MEMORY_ORDER_SEQ_CST) |
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 22 of file SYS_AtomicInt.h.
|
inlineexplicit |
Definition at line 25 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 31 of file SYS_AtomicInt.h.
|
inline |
Atomically adds val to myValue, returning the new value of myValue.
Definition at line 123 of file SYS_AtomicInt.h.
|
inline |
Atomically compares (myValue == expected), and if true, replaces myValue with desired. Returns the prior value.
Definition at line 162 of file SYS_AtomicInt.h.
|
inline |
Definition at line 170 of file SYS_AtomicInt.h.
|
inline |
Definition at line 183 of file SYS_AtomicInt.h.
|
inline |
Atomically assigns val to myValue, returning the prior value of myValue.
Definition at line 109 of file SYS_AtomicInt.h.
|
inline |
Atomically adds val to myValue, returning the prior value of myValue.
Definition at line 116 of file SYS_AtomicInt.h.
|
inline |
Definition at line 209 of file SYS_AtomicInt.h.
|
inline |
Atomically set myValue to the maximum of val and myValue. Returns the last known maximal value.
Definition at line 130 of file SYS_AtomicInt.h.
|
inline |
Atomically set myValue to the minimum of val and myValue. Returns the last known minimal value.
Definition at line 146 of file SYS_AtomicInt.h.
SYS_ATOMIC_INLINE T SYS_AtomicInt< T >::relaxedLoad | ( | ) | const |
Forced RELAXED memory load GCC has trouble inlining so we pull the definition up here.
Definition at line 216 of file SYS_AtomicInt.h.
SYS_ATOMIC_INLINE void SYS_AtomicInt< T >::relaxedStore | ( | T | val | ) |
Definition at line 223 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 202 of file SYS_AtomicInt.h.