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

atomic-push Macro

Summary

Like push, but does the operation atomically.

Package

system

Signature

atomic-push obj place => new-place-value

Arguments
obj
An object.
place
One of the specific set of places defined for low level atomic operations.
Values
new-place-value
A list (the new value of place).
Description

The macro atomic-push is the same as cl:push, pushing obj onto the list in place, but is guaranteed atomic for a suitable place.

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

Notes

In many cases the natural inverse of push is delete, but there is no way to do delete atomically, except by using a separate lock, which must also be held while doing the push.

See also

atomic-pop
low-level-atomic-place-p


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