We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d27759e commit d436c9cCopy full SHA for d436c9c
src/main/clojure/clojure/core/async/impl/dispatch.clj
@@ -105,11 +105,10 @@
105
106
(def ^:private virtual-thread?
107
(if virtual-threads-available?
108
- (let [lookup (MethodHandles/lookup)
109
- t (MethodType/methodType Boolean/TYPE)
110
- ^MethodHandle mh (.findVirtual lookup Thread "isVirtual" t)]
111
- (fn [^Thread thread]
112
- (.invokeWithArguments mh [thread])))
+ (let [meth (.getMethod (Class/forName "java.lang.Thread") "isVirtual" (into-array Class []))
+ vargs (object-array 0)]
+ (fn [thread]
+ (.invoke meth thread vargs)))
113
(constantly false)))
114
115
(defn in-vthread? []
0 commit comments