Provides atomic operations including compare-and-set.
ATOMIC.is? returns whether the Val is an atomic reference.
Makes a new atomic with Initial_val as the initial val.
3.81.3. Type atomic¶
An atomic reference.
Returns the val of the Atomic reference.
Sets New_val as the new val of the Atomic reference.
Atomically sets the Next val to the Atomic reference, only if the current val is identical to Expected.
Returns whether the val could be set.
Atomically updates the val of the Atomic reference, and returns a pair of [Old New], where Old is the val just before the update, and New is the val just after the update.
The New val is computed by compute_next(Old), where Old is the current val of the Atomic reference. $compute_next may be invoked multiple times, thus it must not have side-effect.