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.
83
83
[java.util.concurrent ThreadLocalRandom]
84
84
[java.util Arrays ArrayList]))
85
85
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?)
87
89
(require 'clojure.core.async.impl.go))
88
90
89
91
(alias 'core 'clojure.core)
@@ -514,11 +516,6 @@ IOC and vthread code.
514
516
(let [ret (impl/take! port (fn-handler nop false ))]
515
517
(when ret @ret)))
516
518
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
-
522
519
(defn- go* [body env]
523
520
(cond (and (not dispatch/virtual-threads-available?)
524
521
dispatch/target-vthreads?
@@ -533,8 +530,7 @@ IOC and vthread code.
533
530
(thread-call (^:once fn* [] ~@body) :io ))
534
531
535
532
: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)))
538
534
539
535
(defmacro go
540
536
" Asynchronously executes the body, returning immediately to the
Original file line number Diff line number Diff line change 77
77
(let [{:keys [major minor incremental]} *clojure-version*]
78
78
(not (neg? (compare [major minor incremental] [maj min incr])))))
79
79
80
- (def lazy-loading-supported? (at-least-clojure-version? [1 12 3 ]))
81
-
82
80
(def virtual-threads-available?
83
81
(try
84
82
(Class/forName " java.lang.Thread$Builder$OfVirtual" )
You can’t perform that action at this time.
0 commit comments