|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Read (const T &ref_value) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Exchange (T &ref_value, T newValue) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Increment (T &ref_value) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Decrement (T &ref_value) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | PostIncrement (T &ref_value) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | PostDecrement (T &ref_value) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Add (T &ref_value, T addend) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Subtract (T &ref_value, T subtrahend) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | And (T &ref_value, T operand) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Or (T &ref_value, T operand) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | Xor (T &ref_value, T operand) |
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
XII_ALWAYS_INLINE T | CompareExchange (T &ref_value, T expected, T desired) |
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Read (const T &ref_value) |
| Reads the atomic value.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Exchange (T &ref_value, T newValue) |
| Atomically exchanges the value and returns the old one.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Increment (T &ref_value) |
| Atomically increments the value and returns the new value.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Decrement (T &ref_value) |
| Atomically decrements the value and returns the new value.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | PostIncrement (T &ref_value) |
| Atomically increments the value and returns the original value.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | PostDecrement (T &ref_value) |
| Atomically decrements the value and returns the original value.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Add (T &ref_value, T addend) |
| Atomically adds a value to the reference and returns the new value.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Subtract (T &ref_value, T subtrahend) |
| Atomically subtracts a value from the reference and returns the new value.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | And (T &ref_value, T operand) |
| Performs an atomic bitwise AND operation.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Or (T &ref_value, T operand) |
| Performs an atomic bitwise OR operation.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | Xor (T &ref_value, T operand) |
| Performs an atomic bitwise XOR operation.
|
|
template<typename T>
requires xii_is_atomic_compatible_v<T> |
static T | CompareExchange (T &ref_value, T expected, T desired) |
| Performs an atomic compare-and-exchange operation.
|
|
static bool | CompareExchangePointer (void **pDestination, void *pExpected, void *pValue) |
|
This class provides functions to do atomic operations.
Atomic operations are generally faster than mutexes, and should therefore be preferred whenever possible. However only the operations in themselves are atomic, once you execute several of them in sequence, the sequence will not be atomic. Also atomic operations are a lot slower than non-atomic operations, thus you should not use them in code that does not need to be thread-safe. xiiAtomicInteger is built on top of xiiAtomicUtils and provides a more convenient interface to use atomic integer instructions.