fix race condition relating to retrieving path from cache and aot compilation
This commit is contained in:
parent
b19ceb8c0c
commit
9178f38465
1 changed files with 6 additions and 1 deletions
|
|
@ -232,8 +232,13 @@
|
||||||
get-cache-code (if (= platform :clj)
|
get-cache-code (if (= platform :clj)
|
||||||
`(try (i/get-cell ~cache-sym)
|
`(try (i/get-cell ~cache-sym)
|
||||||
(catch ClassCastException e#
|
(catch ClassCastException e#
|
||||||
|
;; With AOT compilation it's possible for:
|
||||||
|
;; Thread 1: unbound, so throw exception
|
||||||
|
;; Thread 2: unbound, so throw exception
|
||||||
|
;; Thread 1: do alter-var-root
|
||||||
|
;; Thread 2: it's bound, so retrieve the current value
|
||||||
(if (bound? (var ~cache-sym))
|
(if (bound? (var ~cache-sym))
|
||||||
(throw e#)
|
(i/get-cell ~cache-sym)
|
||||||
(do
|
(do
|
||||||
(alter-var-root
|
(alter-var-root
|
||||||
(var ~cache-sym)
|
(var ~cache-sym)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue