File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
src/main/clojure/clojure/core Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ unset - default to ioc when aot, always
156156 (let [as (mapv #(list 'quote %) arglist)
157157 blockingop (-> op name (str " !" ) symbol)]
158158 `(def ~(with-meta op {:arglists `(list ~as) :doc doc})
159- (if (dispatch/targetting -vthreads? )
159+ (if (dispatch/runtime -vthreads? )
160160 (fn [~'& ~'args]
161161 ~(list* apply blockingop '[args]))
162162 (fn ~arglist
@@ -511,7 +511,7 @@ unset - default to ioc when aot, always
511511 Returns a channel which will receive the result of the body when
512512 completed"
513513 [& body]
514- (if (dispatch/targetting -vthreads? )
514+ (if (or ( dispatch/aot -vthreads? ) ( dispatch/runtime-vthreads? ) )
515515 `(thread-call (^:once fn* [] ~@body) :io )
516516 (#'clojure.core.async.impl.go/go-impl &env body)))
517517
Original file line number Diff line number Diff line change 7575 [s]
7676 (= s (System/getProperty " clojure.core.async.vthreads" )))
7777
78- (defn targetting-vthreads? []
79- (or (and aot-compiling? (vthreads-directive-of " target" ))
80- (and (not aot-compiling?)
81- (not (vthreads-directive-of " avoid" ))
82- virtual-threads-available?)))
78+ (defn aot-vthreads? []
79+ (and aot-compiling? (vthreads-directive-of " target" )))
80+
81+ (defn runtime-vthreads? []
82+ (and (not aot-compiling?)
83+ (not (vthreads-directive-of " avoid" ))
84+ virtual-threads-available?))
8385
8486(defn- make-io-executor
8587 []
86- (if (targetting -vthreads? )
88+ (if (runtime -vthreads? )
8789 (-> (.getDeclaredMethod Executors " newVirtualThreadPerTaskExecutor" (make-array Class 0 ))
8890 (.invoke nil (make-array Class 0 )))
8991 (make-ctp-named :io )))
You can’t perform that action at this time.
0 commit comments