Instance Methodswift-nio 2.72.0NIOConcurrencyHelpers
store(_:)
Atomically replaces the value of this object with value
.
This declaration is deprecated: AtomicBox is deprecated without replacement because the original implementation doesn't work.
func store(_ value: T)
Parameters
- value
The new value to set the object to.
This implementation uses a relaxed memory ordering. This guarantees nothing more than that this operation is atomic: there is no guarantee that any other event will be ordered before or after this one.
Other members in extension
Type members
Show obsolete interfaces (1)
Hide obsolete interfaces
Instance members
Show obsolete interfaces (3)
Hide obsolete interfaces
func compareAndExchange(expected: T, desired: T
) -> Bool Atomically compares the value against
expected
and, if they are equal, replaces the value withdesired
.func exchange(with: T
) -> T Atomically exchanges
value
for the current value of this object.func load(
) -> T Atomically loads and returns the value of this object.