OSDecAtomic

Syntax

#include <cafe/os.h>

#define OSDecAtomic(ptr) OSAddAtomic(ptr, -1)

Parameters

ptr Pointer to data to decrement atomically.

Return Values

s32 with the previous value.

Description

OSDecAtomic performs an atomic decrement by 1 with a value in memory. This is useful if the value needs to be atomically manipulated by multiple processors.

It does not act as a memory barrier.

Do Not Call From

None.

See Also

OSAddAtomic
OSAndAtomic
OSCompareAndSwapAtomic
OSCompareAndSwapAtomicEx
OSIncAtomic
OSOrAtomic
OSSwapAtomic
OSTestAndClearAtomic
OSTestAndSetAtomic
OSXorAtomic

Revision History

2013/05/08 Automated cleanup pass.
2012/07/25 Cleanup Pass
2010/08/30 Initial version.


CONFIDENTIAL