Scieneer Common Lisp 1.3.9 online documentation

kernel:setf-conditional place old-value new-value &environment env[Macro]

Atomically compare the value in the specified place to old-value and if eq then store new-value in place. The original value in place is returned. The macro compiles to fast inline code for a range of places: special symbols, symbol-value, symbol-plist, car and cdr, svref, slot-value, and structure slot accessor functions. This macro may be used for fast inline thread synchronization, and forms the basis of a number of higher level macros: kernel:with-atomic-modification, kernel:atomic-push, kernel:atomic-pop, kernel:atomic-incf, and kernel:atomic-decf.

If the place is not yet supported for compilation to inline code then the operation is synchronized using thread:with-exclusive-execution. This is much slower and does not scale well on multi-processors systems because it stops all other threads, so a warning is generated.