File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
src/main/clojure/clojure/core Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ IOC and vthread code.
8383 [java.util.concurrent ThreadLocalRandom]
8484 [java.util Arrays ArrayList]))
8585
86- (when (not dispatch/lazy-loading-supported?)
86+ (def ^:private lazy-loading-supported? (dispatch/at-least-clojure-version? [1 12 3 ]))
87+
88+ (when (not lazy-loading-supported?)
8789 (require 'clojure.core.async.impl.go))
8890
8991(alias 'core 'clojure.core)
@@ -514,11 +516,6 @@ IOC and vthread code.
514516 (let [ret (impl/take! port (fn-handler nop false ))]
515517 (when ret @ret)))
516518
517- (defn- dynamic-require [nsym]
518- (when (and dispatch/lazy-loading-supported?
519- (not (contains? @@#'clojure.core/*loaded-libs* nsym)))
520- (#'clojure.core/serialized-require nsym)))
521-
522519(defn- go* [body env]
523520 (cond (and (not dispatch/virtual-threads-available?)
524521 dispatch/target-vthreads?
@@ -533,8 +530,7 @@ IOC and vthread code.
533530 (thread-call (^:once fn* [] ~@body) :io ))
534531
535532 :else
536- (do (dynamic-require 'clojure.core.async.impl.go)
537- ((find-var 'clojure.core.async.impl.go/go-impl) env body))))
533+ ((requiring-resolve 'clojure.core.async.impl.go/go-impl) env body)))
538534
539535(defmacro go
540536 " Asynchronously executes the body, returning immediately to the
Original file line number Diff line number Diff line change 7777 (let [{:keys [major minor incremental]} *clojure-version*]
7878 (not (neg? (compare [major minor incremental] [maj min incr])))))
7979
80- (def lazy-loading-supported? (at-least-clojure-version? [1 12 3 ]))
81-
8280(def virtual-threads-available?
8381 (try
8482 (Class/forName " java.lang.Thread$Builder$OfVirtual" )
You can’t perform that action at this time.
0 commit comments