add(_:)

Atomically adds rhs to this object.

atomics.swift:106

This declaration is deprecated: please use UnsafeAtomic from https://github.com/apple/swift-atomics instead

@discardableResult func add(_ rhs: T) -> T

Parameters

rhs

The value to add to this object.

Returns

The previous value of this object, before the addition occurred.

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.