#include <libkern/OSAtomicDeprecated.h>
libkern/OSAtomicDeprecated.h
@header
These are deprecated legacy interfaces for atomic operations.
The C11 interfaces in <stdatomic.h> resp. C++11 interfaces in <atomic>
should be used instead.
Define OSATOMIC_USE_INLINED=1 to get inline implementations of these
interfaces in terms of the <stdatomic.h> resp. <atomic> primitives.
This is intended as a transition convenience, direct use of those primitives
is preferred.
macroOSATOMIC_DEPRECATED
#define OSATOMIC_DEPRECATED 1
macroOSATOMIC_BARRIER_DEPRECATED_MSG
#define OSATOMIC_BARRIER_DEPRECATED_MSG(_r) "Use " #_r "() from <stdatomic.h> instead"
macroOSATOMIC_DEPRECATED_MSG
#define OSATOMIC_DEPRECATED_MSG(_r) "Use " #_r "_explicit(memory_order_relaxed) from <stdatomic.h> instead"
macroOSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH
#define OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(_r) __OS_AVAILABILITY_MSG(macosx, deprecated=10.12, OSATOMIC_BARRIER_DEPRECATED_MSG(_r)) __OS_AVAILABILITY_MSG(ios, deprecated=10.0, OSATOMIC_BARRIER_DEPRECATED_MSG(_r)) __OS_AVAILABILITY_MSG(tvos, deprecated=10.0, OSATOMIC_BARRIER_DEPRECATED_MSG(_r)) __OS_AVAILABILITY_MSG(watchos, deprecated=3.0, OSATOMIC_BARRIER_DEPRECATED_MSG(_r))
macroOSATOMIC_DEPRECATED_REPLACE_WITH
#define OSATOMIC_DEPRECATED_REPLACE_WITH(_r) __OS_AVAILABILITY_MSG(macosx, deprecated=10.12, OSATOMIC_DEPRECATED_MSG(_r)) __OS_AVAILABILITY_MSG(ios, deprecated=10.0, OSATOMIC_DEPRECATED_MSG(_r)) __OS_AVAILABILITY_MSG(tvos, deprecated=10.0, OSATOMIC_DEPRECATED_MSG(_r)) __OS_AVAILABILITY_MSG(watchos, deprecated=3.0, OSATOMIC_DEPRECATED_MSG(_r))
typedefOSAtomic_int64_aligned64_t
typedef int64_t OSAtomic_int64_aligned64_t;
functionOSAtomicAdd32
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue )
deprecated
@abstract Atomically adds two 32-bit values.
@discussion This function adds the value given by <code>__theAmount</code> to the
value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicAdd32(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicAdd32Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue )
deprecated
@abstract Atomically adds two 32-bit values.
@discussion This function adds the value given by <code>__theAmount</code> to the
value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicAdd32}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicAdd32Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicIncrement32
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int32_t OSAtomicIncrement32( volatile int32_t *__theValue )
deprecated
@abstract Atomically increments a 32-bit value.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicIncrement32(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicIncrement32Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue )
deprecated
@abstract Atomically increments a 32-bit value with a barrier.
@discussion This function is equivalent to {@link OSAtomicIncrement32}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicIncrement32Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicDecrement32
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int32_t OSAtomicDecrement32( volatile int32_t *__theValue )
deprecated
@abstract Atomically decrements a 32-bit value.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicDecrement32(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicDecrement32Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int32_t OSAtomicDecrement32Barrier( volatile int32_t *__theValue )
deprecated
@abstract Atomically decrements a 32-bit value with a barrier.
@discussion This function is equivalent to {@link OSAtomicDecrement32}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicDecrement32Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicAdd64
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int64_t OSAtomicAdd64( int64_t __theAmount, volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Atomically adds two 64-bit values.
@discussion This function adds the value given by <code>__theAmount</code> to the
value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicAdd64(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicAdd64Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_3_2) int64_t OSAtomicAdd64Barrier( int64_t __theAmount, volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Atomically adds two 64-bit values with a barrier.
@discussion This function adds the value given by <code>__theAmount</code> to the
value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicAdd64}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicAdd64Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicIncrement64
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int64_t OSAtomicIncrement64( volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Atomically increments a 64-bit value.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicIncrement64(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicIncrement64Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_add) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int64_t OSAtomicIncrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Atomically increments a 64-bit value with a barrier.
@discussion This function is equivalent to {@link OSAtomicIncrement64}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicIncrement64Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicDecrement64
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int64_t OSAtomicDecrement64( volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Atomically decrements a 64-bit value.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicDecrement64(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicDecrement64Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_sub) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_1) int64_t OSAtomicDecrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Atomically decrements a 64-bit value with a barrier.
@discussion This function is equivalent to {@link OSAtomicDecrement64}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicDecrement64Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicOr32
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicOr32( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise OR of two 32-bit values.
@discussion This function performs the bitwise OR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicOr32(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicOr32Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicOr32Barrier( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise OR of two 32-bit values with barrier.
@discussion This function performs the bitwise OR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicOr32}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicOr32Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicOr32Orig
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) int32_t OSAtomicOr32Orig( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise OR of two 32-bit values returning original.
@discussion This function performs the bitwise OR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the original value referenced by <code>__theValue</code>.
man page · Mar 7, 2016
OSAtomicOr32Orig(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicOr32OrigBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) int32_t OSAtomicOr32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise OR of two 32-bit values returning original with barrier.
@discussion This function performs the bitwise OR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicOr32Orig}
except that it also introduces a barrier.
@result Returns the original value referenced by <code>__theValue</code>.
man page · Mar 7, 2016
OSAtomicOr32OrigBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicAnd32
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicAnd32( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise AND of two 32-bit values.
@discussion This function performs the bitwise AND of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicAnd32(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicAnd32Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicAnd32Barrier( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise AND of two 32-bit values with barrier.
@discussion This function performs the bitwise AND of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicAnd32}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicAnd32Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicAnd32Orig
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) int32_t OSAtomicAnd32Orig( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise AND of two 32-bit values returning original.
@discussion This function performs the bitwise AND of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the original value referenced by <code>__theValue</code>.
man page · Mar 7, 2016
OSAtomicAnd32Orig(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicAnd32OrigBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) int32_t OSAtomicAnd32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise AND of two 32-bit values returning original with barrier.
@discussion This function performs the bitwise AND of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicAnd32Orig}
except that it also introduces a barrier.
@result Returns the original value referenced by <code>__theValue</code>.
man page · Mar 7, 2016
OSAtomicAnd32OrigBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicXor32
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicXor32( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise XOR of two 32-bit values.
@discussion This function performs the bitwise XOR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicXor32(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicXor32Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicXor32Barrier( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise XOR of two 32-bit values with barrier.
@discussion This function performs the bitwise XOR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicXor32}
except that it also introduces a barrier.
@result Returns the new value.
man page · Mar 7, 2016
OSAtomicXor32Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicXor32Orig
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) int32_t OSAtomicXor32Orig( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise XOR of two 32-bit values returning original.
@discussion This function performs the bitwise XOR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
@result Returns the original value referenced by <code>__theValue</code>.
man page · Mar 7, 2016
OSAtomicXor32Orig(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicXor32OrigBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) int32_t OSAtomicXor32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue )
deprecated
@abstract Atomic bitwise XOR of two 32-bit values returning original with barrier.
@discussion This function performs the bitwise XOR of the value given by <code>__theMask</code>
with the value in the memory location referenced by <code>__theValue</code>,
storing the result back to that memory location atomically.
This function is equivalent to {@link OSAtomicXor32Orig}
except that it also introduces a barrier.
@result Returns the original value referenced by <code>__theValue</code>.
man page · Mar 7, 2016
OSAtomicXor32OrigBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwap32
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue )
deprecated
@abstract Compare and swap for 32-bit values.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwap32(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwap32Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue )
deprecated
@abstract Compare and swap for 32-bit values with barrier.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
This function is equivalent to {@link OSAtomicCompareAndSwap32}
except that it also introduces a barrier.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwap32Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwapPtr
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) bool OSAtomicCompareAndSwapPtr( void *__oldValue, void *__newValue, void * volatile *__theValue )
deprecated
@abstract Compare and swap pointers.
@discussion This function compares the pointer stored in <code>__oldValue</code> to the pointer
in the memory location referenced by <code>__theValue</code>. If the pointers
match, this function stores the pointer from <code>__newValue</code> into
that memory location atomically.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwapPtr(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwapPtrBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) bool OSAtomicCompareAndSwapPtrBarrier( void *__oldValue, void *__newValue, void * volatile *__theValue )
deprecated
@abstract Compare and swap pointers with barrier.
@discussion This function compares the pointer stored in <code>__oldValue</code> to the pointer
in the memory location referenced by <code>__theValue</code>. If the pointers
match, this function stores the pointer from <code>__newValue</code> into
that memory location atomically.
This function is equivalent to {@link OSAtomicCompareAndSwapPtr}
except that it also introduces a barrier.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwapPtrBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwapInt
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) bool OSAtomicCompareAndSwapInt( int __oldValue, int __newValue, volatile int *__theValue )
deprecated
@abstract Compare and swap for <code>int</code> values.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
This function is equivalent to {@link OSAtomicCompareAndSwap32}.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwapInt(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwapIntBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) bool OSAtomicCompareAndSwapIntBarrier( int __oldValue, int __newValue, volatile int *__theValue )
deprecated
@abstract Compare and swap for <code>int</code> values.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
This function is equivalent to {@link OSAtomicCompareAndSwapInt}
except that it also introduces a barrier.
This function is equivalent to {@link OSAtomicCompareAndSwap32Barrier}.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwapIntBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwapLong
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) bool OSAtomicCompareAndSwapLong( long __oldValue, long __newValue, volatile long *__theValue )
deprecated
@abstract Compare and swap for <code>long</code> values.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures,
or {@link OSAtomicCompareAndSwap64} on 64-bit architectures.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwapLong(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwapLongBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) bool OSAtomicCompareAndSwapLongBarrier( long __oldValue, long __newValue, volatile long *__theValue )
deprecated
@abstract Compare and swap for <code>long</code> values.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
This function is equivalent to {@link OSAtomicCompareAndSwapLong}
except that it also introduces a barrier.
This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures,
or {@link OSAtomicCompareAndSwap64} on 64-bit architectures.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwapLongBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwap64
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Compare and swap for <code>uint64_t</code> values.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwap64(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicCompareAndSwap64Barrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_compare_exchange_strong) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_3_2) bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile OSAtomic_int64_aligned64_t *__theValue )
deprecated
@abstract Compare and swap for <code>uint64_t</code> values.
@discussion This function compares the value in <code>__oldValue</code> to the value
in the memory location referenced by <code>__theValue</code>. If the values
match, this function stores the value from <code>__newValue</code> into
that memory location atomically.
This function is equivalent to {@link OSAtomicCompareAndSwap64}
except that it also introduces a barrier.
@result Returns TRUE on a match, FALSE otherwise.
man page · Mar 7, 2016
OSAtomicCompareAndSwap64Barrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicTestAndSet
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_or) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicTestAndSet( uint32_t __n, volatile void *__theAddress )
deprecated
Test and set.
They return the original value of the bit, and operate on bit (0x80>>(n&7))
in byte ((char*)theAddress + (n>>3)).
@abstract Atomic test and set
@discussion This function tests a bit in the value referenced by
<code>__theAddress</code> and if it is not set, sets it.
The bit is chosen by the value of <code>__n</code> such that the
operation will be performed on bit <code>(0x80 >> (__n & 7))</code>
of byte <code>((char *)__theAddress + (n >> 3))</code>.
For example, if <code>__theAddress</code> points to a 64-bit value,
to compare the value of the most significant bit, you would specify
<code>56</code> for <code>__n</code>.
@result Returns the original value of the bit being tested.
man page · Mar 7, 2016
OSAtomicTestAndSet(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicTestAndSetBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_or) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicTestAndSetBarrier( uint32_t __n, volatile void *__theAddress )
deprecated
@abstract Atomic test and set with barrier
@discussion This function tests a bit in the value referenced by <code>__theAddress</code>
and if it is not set, sets it.
The bit is chosen by the value of <code>__n</code> such that the
operation will be performed on bit <code>(0x80 >> (__n & 7))</code>
of byte <code>((char *)__theAddress + (n >> 3))</code>.
For example, if <code>__theAddress</code> points to a 64-bit value,
to compare the value of the most significant bit, you would specify
<code>56</code> for <code>__n</code>.
This function is equivalent to {@link OSAtomicTestAndSet}
except that it also introduces a barrier.
@result Returns the original value of the bit being tested.
man page · Mar 7, 2016
OSAtomicTestAndSetBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicTestAndClear
OSATOMIC_DEPRECATED_REPLACE_WITH(atomic_fetch_and) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress )
deprecated
@abstract Atomic test and clear
@discussion This function tests a bit in the value referenced by <code>__theAddress</code>
and if it is not cleared, clears it.
The bit is chosen by the value of <code>__n</code> such that the
operation will be performed on bit <code>(0x80 >> (__n & 7))</code>
of byte <code>((char *)__theAddress + (n >> 3))</code>.
For example, if <code>__theAddress</code> points to a 64-bit value,
to compare the value of the most significant bit, you would specify
<code>56</code> for <code>__n</code>.
@result Returns the original value of the bit being tested.
man page · Mar 7, 2016
OSAtomicTestAndClear(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSAtomicTestAndClearBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicTestAndClearBarrier( uint32_t __n, volatile void *__theAddress )
deprecated
@abstract Atomic test and clear
@discussion This function tests a bit in the value referenced by <code>__theAddress</code>
and if it is not cleared, clears it.
The bit is chosen by the value of <code>__n</code> such that the
operation will be performed on bit <code>(0x80 >> (__n & 7))</code>
of byte <code>((char *)__theAddress + (n >> 3))</code>.
For example, if <code>__theAddress</code> points to a 64-bit value,
to compare the value of the most significant bit, you would specify
<code>56</code> for <code>__n</code>.
This function is equivalent to {@link OSAtomicTestAndSet}
except that it also introduces a barrier.
@result Returns the original value of the bit being tested.
man page · Mar 7, 2016
OSAtomicTestAndClearBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barrierfunctionOSMemoryBarrier
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_thread_fence) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) void OSMemoryBarrier( void )
deprecated
@abstract Memory barrier.
@discussion This function serves as both a read and write barrier.
man page · Mar 7, 2016
OSMemoryBarrier(3) — deprecated atomic add, increment, decrement, or, and, xor, compare and swap, test and set, test and clear, and memory barriertypedefOSFifoQueueHead
| void * | opaque1 | |
| void * | opaque2 | |
| int | opaque3 |
macroOS_ATOMIC_FIFO_QUEUE_INIT
@abstract The initialization vector for a fifo queue head.
#define OS_ATOMIC_FIFO_QUEUE_INIT { NULL, NULL, 0 }functionOSAtomicFifoEnqueue
__API_DEPRECATED("No longer supported", macos(10.7, 11.0)) void OSAtomicFifoEnqueue(OSFifoQueueHead *__list, void *__new, size_t __offset)
deprecated
@abstract Enqueue an element onto a list.
@discussion Memory barriers are incorporated as needed to permit thread-safe access
to the queue element.
@param __list
The list on which you want to enqueue the element.
@param __new
The element to add.
@param __offset
The "offset" parameter is the offset (in bytes) of the link field
from the beginning of the data structure being queued (<code>__new</code>).
The link field should be a pointer type.
The <code>__offset</code> value needs to be same for all enqueuing and
dequeuing operations on the same list, even if different structure types
are enqueued on that list. The use of <code>offsetset()</code>, defined in
<code>stddef.h</code> is the common way to specify the <code>__offset</code>
value.
@note This API is deprecated and no longer recommended
functionOSAtomicFifoDequeue
__API_DEPRECATED("No longer supported", macos(10.7, 11.0)) void* OSAtomicFifoDequeue(OSFifoQueueHead *__list, size_t __offset)
deprecated
@abstract Dequeue an element from a list.
@discussion Memory barriers are incorporated as needed to permit thread-safe access
to the queue element.
@param __list
The list from which you want to dequeue an element.
@param __offset
The "offset" parameter is the offset (in bytes) of the link field
from the beginning of the data structure being dequeued (<code>__new</code>).
The link field should be a pointer type.
The <code>__offset</code> value needs to be same for all enqueuing and
dequeuing operations on the same list, even if different structure types
are enqueued on that list. The use of <code>offsetset()</code>, defined in
<code>stddef.h</code> is the common way to specify the <code>__offset</code>
value.
@result Returns the oldest enqueued element, or <code>NULL</code> if the
list is empty.
@note This API is deprecated and no longer recommended