#include <cafe/os.h> BOOL OSCompareAndSwapAtomic(volatile OSAtomicVar* ptr, u32 cmp_val, u32 new_val);
|ptr||Pointer to data to compare and swap atomically.|
|cmp_val||Value to compare against memory.|
|new_val||Value to swap into memory.|
TRUE if cmp_val and value contained at address ptr are equal.
FALSE if cmp_val and value contained at address ptr are not equal.
OSCompareAndSwapAtomic performs an atomic swap with a value in memory.
If cmp_val and the value
contained at the address ptr are equal, the value contained
at address ptr is changed to new_val.
This is useful if the value needs to be atomically manipulated by multiple processors.
It does not act as a memory barrier.
2013/05/08 Automated cleanup pass.
2012/07/25 Cleanup Pass
2010/08/30 Initial version.