|
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) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | Exchange (T &ref_value, T newValue) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | Increment (T &ref_value) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | Decrement (T &ref_value) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | PostIncrement (T &ref_value) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | PostDecrement (T &ref_value) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | Add (T &ref_value, T addend) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | Subtract (T &ref_value, T subtrahend) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | And (T &ref_value, T operand) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | Or (T &ref_value, T operand) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | Xor (T &ref_value, T operand) |
template<typename T>
requires xii_is_atomic_compatible_v<T> |
| static T | CompareExchange (T &ref_value, T expected, T desired) |
| static bool | CompareExchangePointer (void **pDestination, void *pExpected, void *pValue) |
Copyright (c) Theophilus Eriata. All Rights Reserved.
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.