Atomics module

atomic_swap

constantSource

Stores value in dest and returns what was there before.

Example↗
x := 1;
old := atomic_swap(*x, 2);
assert(old == 1 && x == 2);
atomic_swap :: atomic_exchange

See also