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."
463
463
(#'clojure.core.async.impl.go/go-impl &env body))
464
464
465
465
(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 )))
467
467
468
468
(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 )))
470
470
471
471
(defn thread-call
472
472
" Executes f in another thread, returning immediately to the calling
Original file line number Diff line number Diff line change 186
186
(is (<!! (thread test-dyn))))))
187
187
188
188
(deftest io-thread-tests
189
- (testing " io-thread"
189
+ (testing " io-thread blocking ops "
190
190
(let [c1 (chan )
191
191
c2 (chan )
192
192
c3 (chan )]
193
193
(io-thread (>!! c2 (clojure.string/upper-case (<!! c1))))
194
194
(io-thread (>!! c3 (clojure.string/reverse (<!! c2))))
195
195
(>!! 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))))))
197
205
198
206
(deftest ops-tests
199
207
(testing " map<"
You can’t perform that action at this time.
0 commit comments