File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
src/main/clojure/clojure/core Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ IOC and vthread code.
169
169
blockingop (-> op name (str " !" ) symbol)]
170
170
`(def ~(with-meta op {:arglists `(list ~as) :doc doc})
171
171
(fn [~'& ~'args]
172
- (if (= " VirtualThread " ( .getSimpleName ( class ( Thread/currentThread ))) )
172
+ (if (dispatch/in-vthread? )
173
173
~(list* apply blockingop '[args])
174
174
(assert nil ~(str op " used not in (go ...) block" )))))))
175
175
Original file line number Diff line number Diff line change 91
91
(and virtual-threads-available?
92
92
(not= (vthreads-directive ) " avoid" )))
93
93
94
+ (defn in-vthread? []
95
+ (= " VirtualThread" (.getSimpleName (class (Thread/currentThread )))))
96
+
94
97
(defn report-vthreads-not-available-error! []
95
98
(throw (ex-info " Code compiled to target virtual threads, but is running without vthread support."
96
99
{:runtime-jvm-version (System/getProperty " java.version" )
You can’t perform that action at this time.
0 commit comments