File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
src/main/clojure/clojure/core Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -468,15 +468,7 @@ to catch and handle."
468468 thread. Returns a channel which will receive the result of calling
469469 f when completed, then close."
470470 [f]
471- (exec-services/best-fit-thread-call f :mixed ))
472-
473- (defmacro io-thread
474- " Executes the body in a thread intended for blocking I/O workloads,
475- returning immediately to the calling thread. The body must not do
476- extended computation (if so, use 'thread' instead). Returns a channel
477- which will receive the result of the body when completed, then close."
478- [& body]
479- `(exec-services/best-fit-thread-call (^:once fn* [] ~@body) :io ))
471+ (exec-services/thread-call f :mixed ))
480472
481473(defmacro thread
482474 " Executes the body in another thread, returning immediately to the
@@ -485,6 +477,14 @@ to catch and handle."
485477 [& body]
486478 `(thread-call (^:once fn* [] ~@body)))
487479
480+ (defmacro io-thread
481+ " Executes the body in a thread intended for blocking I/O workloads,
482+ returning immediately to the calling thread. The body must not do
483+ extended computation (if so, use 'thread' instead). Returns a channel
484+ which will receive the result of the body when completed, then close."
485+ [& body]
486+ `(exec-services/thread-call (^:once fn* [] ~@body) :io ))
487+
488488; ;;;;;;;;;;;;;;;;;;; ops ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
489489
490490(defmacro go-loop
Original file line number Diff line number Diff line change 2222(defonce ^ExecutorService compute-executor
2323 (Executors/newCachedThreadPool (conc/counted-thread-factory " async-compute-%d" true )))
2424
25- (defn best-fit- thread-call
25+ (defn thread-call
2626 [f exec]
2727 (let [c (clojure.core.async/chan 1 )
2828 ^ExecutorService e (case exec
You can’t perform that action at this time.
0 commit comments