Skip to content

Commit 33e4146

Browse files
committed
Tweaked ensure error message. Removed constraint to need vthreads when compiling vthreads.
1 parent 7625fb0 commit 33e4146

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ IOC and vthread code.
8585

8686
(alias 'core 'clojure.core)
8787

88-
(def ^:private go-becomes-ioc?
89-
(not (and (dispatch/vthreads-available-and-allowed?)
90-
(dispatch/target-vthreads?))))
91-
9288
(set! *warn-on-reflection* false)
9389

9490
(defn fn-handler
@@ -559,7 +555,7 @@ IOC and vthread code.
559555
Returns a channel which will receive the result of the body when
560556
completed"
561557
[& body]
562-
(if go-becomes-ioc?
558+
(if (not (dispatch/target-vthreads?))
563559
(do (require-fresh 'clojure.core.async.impl.go)
564560
((find-var 'clojure.core.async.impl.go/go-impl) &env body))
565561
`(do ~(when clojure.core/*compile-files*

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@
9494

9595
(defn ensure-runtime-vthreads! []
9696
(when (not (vthreads-available-and-allowed?))
97-
(throw (ex-info "Code compiled to target virtual threads, but is running on a JVM without vthread support."
98-
{:runtime-jvm-version (System/getProperty "java.version")}))))
97+
(throw (ex-info "Code compiled to target virtual threads, but is running without vthread support."
98+
{:runtime-jvm-version (System/getProperty "java.version")
99+
:vthreads-directive (vthreads-directive)}))))
99100

100101
(defn- make-io-executor
101102
[]

0 commit comments

Comments
 (0)