Skip to content

Instantly share code, notes, and snippets.

@zerokarmaleft
Created September 29, 2011 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerokarmaleft/1251899 to your computer and use it in GitHub Desktop.
Save zerokarmaleft/1251899 to your computer and use it in GitHub Desktop.
SLIME doesn't display the println
(defn stress-ref
[r]
(let [slow-tries (atom 0)]
(future
(dosync
(swap! slow-tries inc)
(Thread/sleep 200)
@r)
(println (format "r is: %s, history: %d, after: %d tries"
@r (ref-history-count r) @slow-tries)))
(dotimes [i 500]
(Thread/sleep 10)
(dosync (alter r inc)))
:done))
(stress-ref (ref 0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment