compareAndExchange method
T
compareAndExchange(
- T expectedValue,
- T newValue
Atomically sets the value to the given newValue
if the current value equals the expectedValue and returns the old value in any case.
Implementation
external T compareAndExchange(T expectedValue, T newValue);