OSTestAndClearAtomic64

Syntax

#include <cafe/os.h>

BOOL OSTestAndClearAtomic64(volatile OSAtomicVar64* ptr, u32 bitnum);

Parameters

ptr Pointer to data to test and clear atomically.
bitnum Bit number to test and clear atomically.

Return Values

TRUE if the previous bit of the value contained in ptr was set. FALSE if the previous bit of the value contained in ptr was not set (cleared).

Description

OSTestAndClearAtomic64 clears the bit for the 64-bit value contained at address ptr. This is useful if the value needs to be atomically manipulated multiple processors.

It does not act as a memory barrier.

CAUTION:
This 64-bit API implementation is much slower than its equivalent 32-bit atomic API version. If 64-bit values are not needed, use the 32-bit atomic API version instead. The 32-bit version is listed in the See Also section of this topic. For more information, see Synchronization and Atomics in the Espresso CPU Performance Guide.

Do Not Call From

None.

See Also

OSAddAtomic64
OSAndAtomic64
OSCompareAndSwapAtomic64
OSCompareAndSwapAtomicEx64
OSDecAtomic64
OSGetAtomic64
OSIncAtomic64
OSOrAtomic64
OSSetAtomic64
OSSwapAtomic64
OSTestAndClearAtomic (32-bit)
OSTestAndSetAtomic64
OSXorAtomic64

Revision History

2014/07/08 Added 64-bit caution.
2013/05/08 Automated cleanup pass.
2010/08/30 Initial version.


CONFIDENTIAL