Skip to content

Commit a17987c

Browse files
committed
CCACHE-65 use locking for the time being (bad)
Signed-off-by: Sean Corfield <sean@corfield.org>
1 parent e14f4ac commit a17987c

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/main/clojure/clojure/core/cache/wrapped.clj

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,18 @@
8585
(let [d-new-value (d-lay #(wrap-fn value-fn e))
8686
hit-or-miss
8787
(fn []
88-
(try
89-
(r-force (c/lookup (swap! cache-atom
90-
c/through-cache
91-
e
92-
default-wrapper-fn
93-
(fn [_] d-new-value))
94-
e
95-
::expired))
96-
(catch Throwable t
97-
(swap! cache-atom c/evict e)
98-
(throw t))))]
88+
(locking cache-atom ; I really do not like this... :(
89+
(try
90+
(r-force (c/lookup (swap! cache-atom
91+
c/through-cache
92+
e
93+
default-wrapper-fn
94+
(fn [_] d-new-value))
95+
e
96+
::expired))
97+
(catch Throwable t
98+
(swap! cache-atom c/evict e)
99+
(throw t)))))]
99100
(loop [n 0 v (hit-or-miss)]
100101
(when (< n 10)
101102
(if (= ::expired v)

0 commit comments

Comments
 (0)