File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/main/clojure/clojure/core Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -475,11 +475,15 @@ to catch and handle."
475
475
" Executes f in another thread, returning immediately to the calling
476
476
thread. Returns a channel which will receive the result of calling
477
477
f when completed, then close."
478
- ([f] (thread-call f mixed-executor))
479
- ([f ^ExecutorService exec]
480
- (let [c (chan 1 )]
478
+ ([f] (thread-call f :mixed ))
479
+ ([f exec]
480
+ (let [c (chan 1 )
481
+ ^ExecutorService e (case exec
482
+ :compute compute-executor
483
+ :io io-executor
484
+ mixed-executor)]
481
485
(let [binds (Var/getThreadBindingFrame )]
482
- (.execute exec
486
+ (.execute e
483
487
(fn []
484
488
(Var/resetThreadBindingFrame binds)
485
489
(try
@@ -496,7 +500,7 @@ to catch and handle."
496
500
extended computation (if so, use 'thread' instead). Returns a channel
497
501
which will receive the result of the body when completed, then close."
498
502
[& body]
499
- `(thread-call (^:once fn* [] ~@body) io-executor ))
503
+ `(thread-call (^:once fn* [] ~@body) :io ))
500
504
501
505
(defmacro thread
502
506
" Executes the body in another thread, returning immediately to the
You can’t perform that action at this time.
0 commit comments