atomic_set() function
Atomic get-and-set. This routine atomically sets @a target to @a value and returns the previous value of @a target.
Arguments
target
Address of atomic variable.
value
Value to write to @a target.
Return value
Previous value of @a target.