Skip to content

Commit ca073b9

Browse files
committed
guard require of go macro machinery
1 parent 948dab7 commit ca073b9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/clojure/clojure/core/async.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ unset - default to ioc when aot, always
6262
[clojure.core.async.impl.timers :as timers]
6363
[clojure.core.async.impl.dispatch :as dispatch]
6464
[clojure.core.async.impl.ioc-macros :as ioc]
65-
clojure.core.async.impl.go ;; TODO: make conditional
6665
[clojure.core.async.impl.mutex :as mutex]
6766
)
6867
(:import [java.util.concurrent.atomic AtomicLong]
@@ -72,6 +71,9 @@ unset - default to ioc when aot, always
7271

7372
(alias 'core 'clojure.core)
7473

74+
(if (not (or (dispatch/aot-vthreads?) (dispatch/runtime-vthreads?)))
75+
(require 'clojure.core.async.impl.go))
76+
7577
(set! *warn-on-reflection* false)
7678

7779
(defn fn-handler
@@ -513,7 +515,7 @@ unset - default to ioc when aot, always
513515
[& body]
514516
(if (or (dispatch/aot-vthreads?) (dispatch/runtime-vthreads?))
515517
`(thread-call (^:once fn* [] ~@body) :io)
516-
(#'clojure.core.async.impl.go/go-impl &env body)))
518+
((find-var 'clojure.core.async.impl.go/go-impl) &env body)))
517519

518520
(defonce ^:private thread-macro-executor nil)
519521

0 commit comments

Comments
 (0)