This library provides atomic operation. The underlying implementation
of this library can be either stdatomic
from C11 or <atomic>
from C++11.
If the platform supports the first one, then that'd be chosen, otherwise
the latter one.
NOTE: if the platform doesn't support none of them, then compilation error.
Returns #t
if the given obj is an atomic object, otherwise #f
.
Creates a fresh atomic object whoes initial value is obj.
Returns #t
if the given obj is an atomic flag object, otherwise #f
.
Creates a fresh atomic flag. The flag is unset.
Returns #t
if the given obj is an atomic fixnum object, otherwise #f
.
fixnum?
)
Creates a fresh atomic fixnum object whoes initial value is n.
Returns #t
if the given obj is an atomic pair object, otherwise #f
.
Creates a fresh atomic pair object whoes initial values are first and tail.
This is double word atomic object.
Returns #t
if the given obj is a fixnum and value of memory order.
The memory order values. The meanings are the same as C11.
If the libatomic_ops
is used as underlying implementation, then it
translate them with the best effort.
Loads the current value of the given atomic of a.
Stores the given value v into the atomic a.
Loads the current value of the given atomic of a.
Stores the given value n into the atomic a. The return value is unspecified.
Operates the addition, subtraction, bitwise or, bitwise xor and bitwise and against the value of atomic a with given n and updates the value of a and returns the previous value of a.
atomic-fixnum?
) (
n
fixnum?
) :optional (
order
memory-order?
)
Exchange the value of a with given v or n and returns the old value of a.
CAS operation. Returns #t
if the operation succeed, otherwise #f
.
CAS operation. Returns previously set value if the operation failed, otherwise the e.
Increment or decrement the value of given a and updates the value.
Establishes memory synchronization ordering of non-atomic and relaxed atomic accesses.