Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kBool kAtomic64s_CompareExchange ( kAtomic64s atomic,
k64s  oldValue,
k64s  value 
)

Conditionally exchanges the value of an atomic variable.

If the atomic value is equal to the oldValue argument, then it is replaced by the value argument.

This method is thread-safe. Implements a full memory barrier.

Parameters
atomicPointer to atomic variable.
oldValuePrevious atomic value.
valueNew atomic value.
Returns
kTRUE if the exchange succeeded.