Atomic operations

Atomic operations

Atomic operations

atomic-invoke function
Invokes function, making sure that only one thread at a time invokes something wrapped inside an atomic-invoke.
>(atomic-invoke (fn () "critical section" (+ 1 2)))
3
atomic [body ...]
Executes the body statements atomically. The body is wrapped in atomic-invoke to ensure that only one such body can execute at a time.
>(atomic (pr "hello"))
hello
"hello"
atlet var value [body ...]
Atomic version of let. The value is assigned to var, and the body is executed, all inside atomic.
atwith args
atwiths args

Copyright 2008 Ken Shirriff.