This merge request adds an atomic exchange operation analogous to Rust's std::sync::atomic::swap (doc) and C++'s std::atomic::exchange (doc).
exchange
std::sync::atomic::swap
std::atomic::exchange
Xchg x y, in one step, reads the value at location x and replaces it with the value of y.
Xchg x y
x
y