Synchronization provides low-level concurrency primitives for safe, lock-free coordination between threads, including atomic values that you read and update with explicit memory orderings. You conform your own types to AtomicRepresentable to make them usable as atomic values, and to AtomicOptionalRepresentable to support atomic optionals. These primitives are available on iOS, macOS, tvOS, watchOS, and visionOS.
Atomic Conformances 2
Protocols you adopt to make your own types usable as atomic values with explicit memory orderings.
- PrAtomicRepresentableiOS 18.0+A type that supports atomic operations through a separate atomic storage
- PrAtomicOptionalRepresentableiOS 18.0+An atomic value that also supports atomic operations when wrapped
Structures 7
- StAtomiciOS 18.0+An atomic value.
- StAtomicLazyReferenceiOS 18.0+A lazily initializable atomic strong reference.
- StAtomicLoadOrderingiOS 18.0+Specifies the memory ordering semantics of an atomic load operation.
- StAtomicStoreOrderingiOS 18.0+Specifies the memory ordering semantics of an atomic store operation.
- StAtomicUpdateOrderingiOS 18.0+Specifies the memory ordering semantics of an atomic read-modify-write
- StMutexiOS 18.0+A synchronization primitive that protects shared mutable state via
- StWordPairiOS 18.0+A pair of two word sized `UInt`s.
Extends 31
BoolFloat16FloatDoubleRawRepresentableOptionalUnsafePointerUnsafeMutablePointerUnsafeRawPointerUnsafeMutableRawPointerUnmanagedOpaquePointerObjectIdentifierUnsafeBufferPointerUnsafeMutableBufferPointerUnsafeRawBufferPointerUnsafeMutableRawBufferPointerNeverDurationIntInt8Int16Int32Int64Int128UIntUInt8UInt16UInt32UInt64UInt128