Bordeaux-Threads

Version 0.8.8

Common Lisp threading library

Function ATOMIC-INTEGER-COMPARE-AND-SWAP

Syntax:

atomic-integer-compare-and-swap atomic-integer old new => generalized-boolean

Arguments and values:

atomic-integer -> an atomic-integer object.
old, new -> non-negative integers.
generalized-boolean -> a generalized boolean.

Description

If the current value of atomic-integer is equal to old, replace it with new.

Returns true if the replacement was successful, otherwise false.

Exceptional situations:

Signals an error of type type-error if atomic-integer is not an atomic-integer object.
Signals an error of type type-error if old is not a non-negative integer.
Signals an error of type type-error if new is not a non-negative integer.

See also:

atomic-integer, atomic-integer-incf, atomic-integer-decf, make-atomic-integer

Notes:

None.

Last updated on 2022-01-07
Published on 2022-01-07
Edit on GitHub