File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
main/clojure/clojure/core
test/clojure/clojure/core Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -463,10 +463,10 @@ to catch and handle."
463463 (#'clojure.core.async.impl.go/go-impl &env body))
464464
465465(defonce ^:private ^Executor thread-macro-executor
466- (Executors/newCachedThreadPool (conc/counted-thread-factory " async-thread-macro- %d" true )))
466+ (Executors/newCachedThreadPool (conc/counted-thread-factory " async-thread-%d" true )))
467467
468468(defonce ^:private ^ExecutorService io-thread-exec
469- (Executors/newCachedThreadPool (conc/counted-thread-factory " io-thread-macro -%d" true )))
469+ (Executors/newCachedThreadPool (conc/counted-thread-factory " async- io-thread-%d" true )))
470470
471471(defn thread-call
472472 " Executes f in another thread, returning immediately to the calling
Original file line number Diff line number Diff line change 186186 (is (<!! (thread test-dyn))))))
187187
188188(deftest io-thread-tests
189- (testing " io-thread"
189+ (testing " io-thread blocking ops "
190190 (let [c1 (chan )
191191 c2 (chan )
192192 c3 (chan )]
193193 (io-thread (>!! c2 (clojure.string/upper-case (<!! c1))))
194194 (io-thread (>!! c3 (clojure.string/reverse (<!! c2))))
195195 (>!! c1 " loop" )
196- (is (= " POOL" (<!! c3))))))
196+ (is (= " POOL" (<!! c3)))))
197+ (testing " io-thread parking op should fail"
198+ (let [c1 (chan )]
199+ (io-thread
200+ (try
201+ (>! c1 :no )
202+ (catch AssertionError _
203+ (>!! c1 :yes ))))
204+ (is (= :yes (<!! c1))))))
197205
198206(deftest ops-tests
199207 (testing " map<"
You can’t perform that action at this time.
0 commit comments