pub unsafe fn atomic_exchange<N: Number, const SCOPE: u32, const SEMANTICS: u32>(
ptr: &mut N,
value: N,
) -> NExpand description
Perform the following steps atomically with respect to any other atomic
accesses within SCOPE to the same location:
- Load through
ptrto get the original value, - Get a new value from copying
value, and - Store the new value back through
ptr.
The result is the original value.