From db2fdcede1520e51ac20ab5e0231d42e190df3a0 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Sun, 25 Nov 2012 16:55:30 -0800 Subject: [PATCH] CLJ-1104: Document unsafety of concurrent calls to with-redefs --- src/clj/clojure/core.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index 985532a..27ffde0 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -6690,8 +6690,9 @@ binding-map will replace the root value of its key which must be a Var. After func is called with no args, the root values of all the Vars will be set back to their old values. These temporary - changes will be visible in all threads. Useful for mocking out - functions during testing." + changes will be visible in all threads. Not safe to use + concurrently on same Vars from multiple threads due to mutating of + root bindings. Useful for mocking out functions during testing." {:added "1.3"} [binding-map func] (let [root-bind (fn [m] -- 1.8.0