All Manuals > LispWorks® User Guide and Reference Manual > 47 The SYSTEM Package

atomic-exchange Macro

Summary

Atomically exchange a place value with a new value, returning the old value.

Package

system

Signature

atomic-exchange place new-value => old-value

Arguments
place
One of the specific set of places defined for low level atomic operations.
new-value
An object.
Values
old-value
An object.
Description

The macro atomic-exchange exchanges the value in place with new-value, returning old-value. The operation is guaranteed to be atomic.

place must be one of the places described in 19.13.1 Low level atomic operations, or expand to one of them.

See also

compare-and-swap
low-level-atomic-place-p


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:31:02