File tree 2 files changed +10
-8
lines changed
src/main/clojure/clojure/core
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
156
156
(let [as (mapv #(list 'quote %) arglist)
157
157
blockingop (-> op name (str " !" ) symbol)]
158
158
`(def ~(with-meta op {:arglists `(list ~as) :doc doc})
159
- (if (dispatch/targetting -vthreads? )
159
+ (if (dispatch/runtime -vthreads? )
160
160
(fn [~'& ~'args]
161
161
~(list* apply blockingop '[args]))
162
162
(fn ~arglist
@@ -511,7 +511,7 @@ unset - default to ioc when aot, always
511
511
Returns a channel which will receive the result of the body when
512
512
completed"
513
513
[& body]
514
- (if (dispatch/targetting -vthreads? )
514
+ (if (or ( dispatch/aot -vthreads? ) ( dispatch/runtime-vthreads? ) )
515
515
`(thread-call (^:once fn* [] ~@body) :io )
516
516
(#'clojure.core.async.impl.go/go-impl &env body)))
517
517
Original file line number Diff line number Diff line change 75
75
[s]
76
76
(= s (System/getProperty " clojure.core.async.vthreads" )))
77
77
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?))
83
85
84
86
(defn- make-io-executor
85
87
[]
86
- (if (targetting -vthreads? )
88
+ (if (runtime -vthreads? )
87
89
(-> (.getDeclaredMethod Executors " newVirtualThreadPerTaskExecutor" (make-array Class 0 ))
88
90
(.invoke nil (make-array Class 0 )))
89
91
(make-ctp-named :io )))
You can’t perform that action at this time.
0 commit comments