File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
src/main/clojure/clojure/core/async/impl Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 7373 [workload]
7474 (Executors/newCachedThreadPool (counted-thread-factory (str " async-" (name workload) " -%d" ) true )))
7575
76- (defn ensure-clojure-version! [maj min incr]
77- (let [{:keys [major minor incremental]} *clojure-version*]
78- (when (neg? (compare [major minor incremental] [maj min incr]))
79- (throw (ex-info (str " core.async go block expander requires Clojure version ≥"
80- maj " ." min " ." incr
81- " to load" )
82- {:clojure-version *clojure-version*})))))
76+ (def ensure-clojure-version!
77+ (memoize
78+ (fn [maj min incr]
79+ (let [{:keys [major minor incremental]} *clojure-version*]
80+ (when (neg? (compare [major minor incremental] [maj min incr]))
81+ (throw (ex-info (str " core.async go block expander requires Clojure version ≥"
82+ maj " ." min " ." incr
83+ " to load" )
84+ {:clojure-version *clojure-version*})))))))
8385
8486(def virtual-threads-available?
8587 (try
105107
106108(def ^:private virtual-thread?
107109 (if virtual-threads-available?
108- (let [meth (.getMethod (Class/forName " java.lang.Thread" ) " isVirtual" (into-array Class []))
109- vargs (object-array 0 )]
110- (fn [thread]
111- (.invoke meth thread vargs)))
110+ (eval `(fn [^Thread t#] (~'.isVirtual t#)))
112111 (constantly false )))
113112
114113(defn in-vthread? []
You can’t perform that action at this time.
0 commit comments