summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/boot.clj11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/clj/clojure/boot.clj b/src/clj/clojure/boot.clj
index 85dc6be5..d4c73f82 100644
--- a/src/clj/clojure/boot.clj
+++ b/src/clj/clojure/boot.clj
@@ -3007,6 +3007,11 @@
*loaded-libs* (ref (sorted-set)))
(defonce
+ #^{:private true
+ :doc "the set of paths currently being loaded by this thread"}
+ *pending-paths* #{})
+
+(defonce
#^{:private true :doc
"True while a verbose load is pending"}
*loading-verbosely* false)
@@ -3212,7 +3217,11 @@
(when *loading-verbosely*
(printf "(clojure/load \"%s\")\n" path)
(flush))
- (.loadResourceScript clojure.lang.RT (.substring path 1)))))
+ (throw-if (*pending-paths* path)
+ "cannot load '%s' again while it is loading"
+ path)
+ (binding [*pending-paths* (conj *pending-paths* path)]
+ (.loadResourceScript clojure.lang.RT (.substring path 1))))))
;;;;;;;;;;;;; nested associative ops ;;;;;;;;;;;