Performs a conditional store, atomically.
system
compare-and-swap place compare new-value => result
place⇩ |
One of the specific set of places defined for low level atomic operations. |
compare⇩ |
An object. |
new-value⇩ |
An object. |
result |
A boolean. |
The macro compare-and-swap
compares the value in place with compare, and if they are the same (by eq), stores new-value in place.
compare-and-swap
returns non-nil if the store occurred, or nil
if the store did not occur.
place must be one of the places described in 19.13.1 Low level atomic operations, or expand to one of them.
The operation is guaranteed to be atomic.
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:31:02