Atomic
An atomic value.
- iOS
- 18.0+
- macOS
- 15.0+
- tvOS
- 18.0+
- visionOS
- 2.0+
- watchOS
- 11.0+
@frozen struct Atomic<Value> where Value : AtomicRepresentable
An atomic value.
@frozen struct Atomic<Value> where Value : AtomicRepresentable
import Synchronization
protocol AtomicRepresentable
A type that supports atomic operations through a separate atomic storage representation.
init(_ initialValue: consuming Value)
Initializes a value of this atomic with the given initial value.
protocol Sendable
func compareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified memory ordering.
func compareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified success/failure memory orderings.
func exchange(_ desired: consuming Value, ordering: AtomicUpdateOrdering) -> Value
Atomically sets the current value to desired
and returns the original value, applying the specified memory ordering.
func load(ordering: AtomicLoadOrdering) -> Value
Atomically loads and returns the current value, applying the specified memory ordering.
func store(_ desired: consuming Value, ordering: AtomicStoreOrdering)
Atomically sets the current value to desired
, applying the specified memory ordering.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the memory ordering. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the specified success/failure memory orderings. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func compareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified memory ordering.
func compareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified success/failure memory orderings.
func exchange(_ desired: consuming Value, ordering: AtomicUpdateOrdering) -> Value
Atomically sets the current value to desired
and returns the original value, applying the specified memory ordering.
func load(ordering: AtomicLoadOrdering) -> Value
Atomically loads and returns the current value, applying the specified memory ordering.
func store(_ desired: consuming Value, ordering: AtomicStoreOrdering)
Atomically sets the current value to desired
, applying the specified memory ordering.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the memory ordering. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the specified success/failure memory orderings. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func compareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified memory ordering.
func compareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified success/failure memory orderings.
func exchange(_ desired: consuming Value, ordering: AtomicUpdateOrdering) -> Value
Atomically sets the current value to desired
and returns the original value, applying the specified memory ordering.
func load(ordering: AtomicLoadOrdering) -> Value
Atomically loads and returns the current value, applying the specified memory ordering.
func store(_ desired: consuming Value, ordering: AtomicStoreOrdering)
Atomically sets the current value to desired
, applying the specified memory ordering.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the memory ordering. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the specified success/failure memory orderings. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func compareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified memory ordering.
func compareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified success/failure memory orderings.
func exchange(_ desired: consuming Value, ordering: AtomicUpdateOrdering) -> Value
Atomically sets the current value to desired
and returns the original value, applying the specified memory ordering.
func load(ordering: AtomicLoadOrdering) -> Value
Atomically loads and returns the current value, applying the specified memory ordering.
func store(_ desired: consuming Value, ordering: AtomicStoreOrdering)
Atomically sets the current value to desired
, applying the specified memory ordering.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the memory ordering. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the specified success/failure memory orderings. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func compareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified memory ordering.
func compareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic compare and exchange operation on the current value, applying the specified success/failure memory orderings.
func exchange(_ desired: consuming Value, ordering: AtomicUpdateOrdering) -> Value
Atomically sets the current value to desired
and returns the original value, applying the specified memory ordering.
func load(ordering: AtomicLoadOrdering) -> Value
Atomically loads and returns the current value, applying the specified memory ordering.
func store(_ desired: consuming Value, ordering: AtomicStoreOrdering)
Atomically sets the current value to desired
, applying the specified memory ordering.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, ordering: AtomicUpdateOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the memory ordering. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
func weakCompareExchange(expected: consuming Value, desired: consuming Value, successOrdering: AtomicUpdateOrdering, failureOrdering: AtomicLoadOrdering) -> (exchanged: Bool, original: Value)
Perform an atomic weak compare and exchange operation on the current value, applying the specified success/failure memory orderings. This compare-exchange variant is allowed to spuriously fail; it is designed to be called in a loop until it indicates a successful exchange has happened.
@frozen struct Bool
A value type whose instances are either true
or false
.
@discardableResult func logicalAnd(_ operand: Bool, ordering: AtomicUpdateOrdering) -> (oldValue: Bool, newValue: Bool)
Perform an atomic logical AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func logicalOr(_ operand: Bool, ordering: AtomicUpdateOrdering) -> (oldValue: Bool, newValue: Bool)
Perform an atomic logical OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func logicalXor(_ operand: Bool, ordering: AtomicUpdateOrdering) -> (oldValue: Bool, newValue: Bool)
Perform an atomic logical XOR operation and return the old and new value, applying the specified memory ordering.
@frozen struct Int
A signed integer value type.
@discardableResult func add(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: Int, ordering: AtomicUpdateOrdering) -> (oldValue: Int, newValue: Int)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct UInt
An unsigned integer value type.
@discardableResult func add(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: UInt, ordering: AtomicUpdateOrdering) -> (oldValue: UInt, newValue: UInt)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct Int8
An 8-bit signed integer value type.
@discardableResult func add(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: Int8, ordering: AtomicUpdateOrdering) -> (oldValue: Int8, newValue: Int8)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct Int16
A 16-bit signed integer value type.
@discardableResult func add(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: Int16, ordering: AtomicUpdateOrdering) -> (oldValue: Int16, newValue: Int16)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct Int32
A 32-bit signed integer value type.
@discardableResult func add(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: Int32, ordering: AtomicUpdateOrdering) -> (oldValue: Int32, newValue: Int32)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct Int64
A 64-bit signed integer value type.
@discardableResult func add(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: Int64, ordering: AtomicUpdateOrdering) -> (oldValue: Int64, newValue: Int64)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct UInt8
An 8-bit unsigned integer value type.
@discardableResult func add(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: UInt8, ordering: AtomicUpdateOrdering) -> (oldValue: UInt8, newValue: UInt8)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct Int128
A 128-bit signed integer type.
@discardableResult func add(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: Int128, ordering: AtomicUpdateOrdering) -> (oldValue: Int128, newValue: Int128)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct UInt16
A 16-bit unsigned integer value type.
@discardableResult func add(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: UInt16, ordering: AtomicUpdateOrdering) -> (oldValue: UInt16, newValue: UInt16)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct UInt32
A 32-bit unsigned integer value type.
@discardableResult func add(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: UInt32, ordering: AtomicUpdateOrdering) -> (oldValue: UInt32, newValue: UInt32)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct UInt64
A 64-bit unsigned integer value type.
@discardableResult func add(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: UInt64, ordering: AtomicUpdateOrdering) -> (oldValue: UInt64, newValue: UInt64)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.
@frozen struct UInt128
A 128-bit unsigned integer type.
@discardableResult func add(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseAnd(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic bitwise AND operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseOr(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic bitwise OR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func bitwiseXor(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic bitwise XOR operation and return the old and new value, applying the specified memory ordering.
@discardableResult func max(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic maximum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func min(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic minimum operation and return the old and new value, applying the specified memory ordering.
@discardableResult func subtract(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic subtract operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingAdd(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic wrapping add operation and return the old and new value, applying the specified memory ordering.
@discardableResult func wrappingSubtract(_ operand: UInt128, ordering: AtomicUpdateOrdering) -> (oldValue: UInt128, newValue: UInt128)
Perform an atomic wrapping subtract operation and return the old and new value, applying the specified memory ordering.