Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
AtomicsWrapper

Macros

#define GTS_MEMORY_ORDER_RELAXED   #error "Replace with custom definition"
 
#define GTS_MEMORY_ORDER_CONSUME   #error "Replace with custom definition"
 
#define GTS_MEMORY_ORDER_ACQUIRE   #error "Replace with custom definition"
 
#define GTS_MEMORY_ORDER_RELEASE   #error "Replace with custom definition"
 
#define GTS_MEMORY_ORDER_ACQ_REL   #error "Replace with custom definition"
 
#define GTS_MEMORY_ORDER_SEQ_CST   #error "Replace with custom definition"
 
#define GTS_ATOMIC_TYPE   #error "Replace with custom definition"
 An atomic type to be used as GTS_ATOMIC_TYPE<T>
 
#define GTS_ATOMIC_LOAD(a, memoryOrder)   #error "Replace with custom definition"
 Atomically loads the contents of a with the specified memory order. More...
 
#define GTS_ATOMIC_STORE(a, value, memoryOrder)   #error "Replace with custom definition"
 
#define GTS_ATOMIC_FETCH_ADD(a, inc, memoryOrder)   #error "Replace with custom definition"
 Atomically adds addend to a with the specified memory order. More...
 
#define GTS_ATOMIC_FETCH_AND(a, rhs, memoryOrder)   #error "Replace with custom definition"
 Atomically ANDs rhs to a with the specified memory order. More...
 
#define GTS_ATOMIC_FETCH_OR(a, rhs, memoryOrder)   #error "Replace with custom definition"
 
#define GTS_ATOMIC_EXCHANGE(a, value, memoryOrder)   #error "Replace with custom definition"
 
#define GTS_ATOMIC_COMPARE_EXCHANGE_WEAK(a, expected, value, xchgMemoryOrder, loadMemoryOrder)   #error "Replace with custom definition"
 Atomically compares a with expected and stores value in a if a==expected with xchgMemoryOrder, otheriwse stores value in expected with loadMemoryOrder. Weak implies the compare may spuriously fail. More...
 
#define GTS_ATOMIC_COMPARE_EXCHANGE_STRONG(a, expected, value, xchgMemoryOrder, loadMemoryOrder)   #error "Replace with custom definition"
 

Detailed Description

User defined wrappers for the atomics API.

Macro Definition Documentation

◆ GTS_ATOMIC_COMPARE_EXCHANGE_WEAK

#define GTS_ATOMIC_COMPARE_EXCHANGE_WEAK (   a,
  expected,
  value,
  xchgMemoryOrder,
  loadMemoryOrder 
)    #error "Replace with custom definition"

Atomically compares a with expected and stores value in a if a==expected with xchgMemoryOrder, otheriwse stores value in expected with loadMemoryOrder. Weak implies the compare may spuriously fail.

Atomically compares a with expected and stores value in a if a==expected with xchgMemoryOrder, otheriwse stores value in expected with loadMemoryOrder.

Remarks
Signature:
template<typename T>
bool compare_exchange_weak(GTS_ATOMIC_TYPE<T>& atomic, T& expected, T value, int32_t xchgOrder, int32_t loadOrder)
Returns
True if a==expected.
Remarks
Signature:
template<typename T>
bool compare_exchange_strong(GTS_ATOMIC_TYPE<T>& atomic, T& expected, T value, int32_t xchgOrder, int32_t loadOrder)
Returns
True if a==expected.

◆ GTS_ATOMIC_FETCH_ADD

#define GTS_ATOMIC_FETCH_ADD (   a,
  inc,
  memoryOrder 
)    #error "Replace with custom definition"

Atomically adds addend to a with the specified memory order.

Remarks
Signature:
template<typename T>
T fetch_add(GTS_ATOMIC_TYPE<T>& a, T inc, int32_t order)
Returns
The value of a before the ADD.

◆ GTS_ATOMIC_FETCH_AND

#define GTS_ATOMIC_FETCH_AND (   a,
  rhs,
  memoryOrder 
)    #error "Replace with custom definition"

Atomically ANDs rhs to a with the specified memory order.

Atomically exchanges rhs and a with the specified memory order.

Atomically ORs rhs and a with the specified memory order.

Remarks
Signature:
template<typename T>
T fetch_and(GTS_ATOMIC_TYPE<T>& a, T rhs, int32_t order)
Returns
The value of a before the AND.
Remarks
Signature:
template<typename T>
T exchange(GTS_ATOMIC_TYPE<T>& a, T value, int32_t order)
Returns
The value of a before the OR.
Remarks
Signature:
template<typename T>
T exchange(GTS_ATOMIC_TYPE<T>& a, T value, int32_t order)
Returns
The value of a before the exchange.

◆ GTS_ATOMIC_LOAD

#define GTS_ATOMIC_LOAD (   a,
  memoryOrder 
)    #error "Replace with custom definition"

Atomically loads the contents of a with the specified memory order.

Atomically stores value into a with the specified memory order.

Remarks
Signature:
template<typename T>
T load(GTS_ATOMIC_TYPE<T> const& a, int32_t order)
Returns
The loaded value.
Remarks
Signature:
template<typename T>
void store(GTS_ATOMIC_TYPE<T>& a, T value, int32_t memoryOrder)