Warning: This is the manual of the legacy Guile 2.2 series. You may want to read the manual of the current stable series instead.

Next: , Previous: , Up: Instruction Set   [Contents][Index]


9.3.7.11 Inlined Atomic Instructions

See Atomics, for more on atomic operations in Guile.

Instruction: make-atomic-box s12:dst s12:src

Create a new atomic box initialized to src, and place it in dst.

Instruction: atomic-box-ref s12:dst s12:box

Fetch the value of the atomic box at box into dst.

Instruction: atomic-box-set! s12:box s12:val

Set the contents of the atomic box at box to val.

Instruction: atomic-box-swap! s12:dst s12:box x8:_ s24:val

Replace the contents of the atomic box at box to val and store the previous value at dst.

Instruction: atomic-box-compare-and-swap! s12:dst s12:box x8:_ s24:expected x8:_ s24:desired

If the value of the atomic box at box is the same as the SCM value at expected (in the sense of eq?), replace the contents of the box with the SCM value at desired. Otherwise does not update the box. Set dst to the previous value of the box in either case.