Created
September 29, 2011 20:45
-
-
Save zerokarmaleft/1251899 to your computer and use it in GitHub Desktop.
SLIME doesn't display the println
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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