Atomic<T>.compareExchange
Description
Atomically replace and return the stored T value with a new T value only if the stored value is equal to the specified comparison value.
If the comparison value is equal to the stored value, then the successOrder MemoryOrder is used, otherwise the failOrder MemoryOrder is used.
successOrder must be at least as strong as failOrder
failOrder must not be MemoryOrder.Release or MemoryOrder.AcquireRelease
Signature
T Atomic<T>.compareExchange( T compareValue, T newValue, MemoryOrder successOrder, MemoryOrder failOrder) where T : IAtomicable;