15using std::memory_order;
16using std::memory_order_relaxed;
17using std::memory_order_acquire;
18using std::memory_order_release;
19using std::memory_order_acq_rel;
20using std::memory_order_seq_cst;
24bool AtomicMin(atomic<T> &ioAtomic,
const T inValue,
const memory_order inMemoryOrder = memory_order_seq_cst)
26 T cur_value = ioAtomic.load(memory_order_relaxed);
27 while (cur_value > inValue)
28 if (ioAtomic.compare_exchange_weak(cur_value, inValue, inMemoryOrder))
35bool AtomicMax(atomic<T> &ioAtomic,
const T inValue,
const memory_order inMemoryOrder = memory_order_seq_cst)
37 T cur_value = ioAtomic.load(memory_order_relaxed);
38 while (cur_value < inValue)
39 if (ioAtomic.compare_exchange_weak(cur_value, inValue, inMemoryOrder))
bool AtomicMax(atomic< T > &ioAtomic, const T inValue, const memory_order inMemoryOrder=memory_order_seq_cst)
Atomically compute the max(ioAtomic, inValue) and store it in ioAtomic, returns true if value was upd...
Definition: Atomics.h:35
bool AtomicMin(atomic< T > &ioAtomic, const T inValue, const memory_order inMemoryOrder=memory_order_seq_cst)
Atomically compute the min(ioAtomic, inValue) and store it in ioAtomic, returns true if value was upd...
Definition: Atomics.h:24
#define JPH_SUPPRESS_WARNINGS_STD_BEGIN
Definition: Core.h:383
#define JPH_SUPPRESS_WARNINGS_STD_END
Definition: Core.h:395
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372