Pebble Coding

ソフトウェアエンジニアによるIT技術、数学の備忘録

swiftで使えるAtomic系API (OSX/iOS)

swiftで使えるAtomic系APIがあったので備忘録としてリストアップしておく。
OSX/iOSで確認した。

func OSAtomicAdd32(__theAmount: Int32, __theValue: UnsafeMutablePointer<Int32>) -> Int32
func OSAtomicAdd32Barrier(__theAmount: Int32, __theValue: UnsafeMutablePointer<Int32>) -> Int32
func OSAtomicIncrement32(__theValue: UnsafeMutablePointer<Int32>) -> Int32
func OSAtomicIncrement32Barrier(__theValue: UnsafeMutablePointer<Int32>) -> Int32
func OSAtomicDecrement32(__theValue: UnsafeMutablePointer<Int32>) -> Int32
func OSAtomicDecrement32Barrier(__theValue: UnsafeMutablePointer<Int32>) -> Int32
func OSAtomicAdd64(__theAmount: Int64, __theValue: UnsafeMutablePointer<Int64>) -> Int64
func OSAtomicAdd64Barrier(__theAmount: Int64, __theValue: UnsafeMutablePointer<Int64>) -> Int64
func OSAtomicIncrement64(__theValue: UnsafeMutablePointer<Int64>) -> Int64 
func OSAtomicIncrement64Barrier(__theValue: UnsafeMutablePointer<Int64>) -> Int64 
func OSAtomicDecrement64(__theValue: UnsafeMutablePointer<Int64>) -> Int64 
func OSAtomicDecrement64Barrier(__theValue: UnsafeMutablePointer<Int64>) -> Int64
func OSAtomicOr32(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicOr32Barrier(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicOr32Orig(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicOr32OrigBarrier(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicAnd32(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicAnd32Barrier(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicAnd32Orig(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicAnd32OrigBarrier(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicXor32(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicXor32Barrier(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicXor32Orig(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicXor32OrigBarrier(__theMask: UInt32, __theValue: UnsafeMutablePointer<UInt32>) -> Int32
func OSAtomicCompareAndSwap32(__oldValue: Int32, __newValue: Int32, __theValue: UnsafeMutablePointer<Int32>) -> Bool
func OSAtomicCompareAndSwap32Barrier(__oldValue: Int32, __newValue: Int32, __theValue: UnsafeMutablePointer<Int32>) -> Bool
func OSAtomicCompareAndSwapPtr(__oldValue: UnsafeMutablePointer<Void>, __newValue: UnsafeMutablePointer<Void>, __theValue: UnsafeMutablePointer<UnsafeMutablePointer<Void>>) -> Bool
func OSAtomicCompareAndSwapPtrBarrier(__oldValue: UnsafeMutablePointer<Void>, __newValue: UnsafeMutablePointer<Void>, __theValue: UnsafeMutablePointer<UnsafeMutablePointer<Void>>) -> Bool
func OSAtomicCompareAndSwapInt(__oldValue: Int32, __newValue: Int32, __theValue: UnsafeMutablePointer<Int32>) -> Bool
func OSAtomicCompareAndSwapIntBarrier(__oldValue: Int32, __newValue: Int32, __theValue: UnsafeMutablePointer<Int32>) -> Bool
func OSAtomicCompareAndSwapLong(__oldValue: Int, __newValue: Int, __theValue: UnsafeMutablePointer<Int>) -> Bool
func OSAtomicCompareAndSwapLongBarrier(__oldValue: Int, __newValue: Int, __theValue: UnsafeMutablePointer<Int>) -> Bool
func OSAtomicCompareAndSwap64(__oldValue: Int64, __newValue: Int64, __theValue: UnsafeMutablePointer<Int64>) -> Bool
func OSAtomicCompareAndSwap64Barrier(__oldValue: Int64, __newValue: Int64, __theValue: UnsafeMutablePointer<Int64>) -> Bool
func OSAtomicTestAndSet(__n: UInt32, __theAddress: UnsafeMutablePointer<Void>) -> Bool
func OSAtomicTestAndSetBarrier(__n: UInt32, __theAddress: UnsafeMutablePointer<Void>) -> Bool
func OSAtomicTestAndClear(__n: UInt32, __theAddress: UnsafeMutablePointer<Void>) -> Bool
func OSAtomicTestAndClearBarrier(__n: UInt32, __theAddress: UnsafeMutablePointer<Void>) -> Bool
var OS_SPINLOCK_INIT: Int32 { get }
typealias OSSpinLock = Int32
func OSSpinLockTry(__lock: UnsafeMutablePointer<OSSpinLock>) -> Bool
func OSSpinLockLock(__lock: UnsafeMutablePointer<OSSpinLock>)
func OSSpinLockUnlock(__lock: UnsafeMutablePointer<OSSpinLock>)
func OSAtomicEnqueue(__list: COpaquePointer, __new: UnsafeMutablePointer<Void>, __offset: Int)
func OSAtomicDequeue(__list: COpaquePointer, __offset: Int) -> UnsafeMutablePointer<Void>
func OSAtomicFifoEnqueue(__list: COpaquePointer, __new: UnsafeMutablePointer<Void>, __offset: Int)
func OSAtomicFifoDequeue(__list: COpaquePointer, __offset: Int) -> UnsafeMutablePointer<Void>
func OSMemoryBarrier()

C++ Concurrency in Action: Practical Multithreading

C++ Concurrency in Action: Practical Multithreading