Non-atomically swaps the value of the volatile as if: (apply f current-value-of-vol args). Returns the value that was swapped in.
(let [interrupt (volatile! false) f1 (future (Thread/sleep 1000) (vswap! interrupt not)) f2 (future (while (not @interrupt) (println "Another cycle!") (Thread/sleep 100)))] @f1 @f2)
Creates and returns a Volatile with an initial value of val.
Sets the value of volatile to newval without regard for the current value. Returns newval.
Returns true if x is a volatile.
Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be...
vswap!