@@ -53,10 +53,10 @@ If AOT compiling, go blocks will always use IOC so that the resulting
5353bytecode works on all JVMs (so no change in compiled output)
5454
5555\" target\" - means that you are targeting virtual threads. At runtime
56- from source, go blocks will use vthreads if available, but will fall back
57- to IOC if not available. If AOT compiling, go blocks are always compiled
58- as normal Clojure code to be run on vthreads and will throw at runtime
59- if vthreads are not available (Java <21)
56+ from source, go blocks will throw if vthreads are not available.
57+ If AOT compiling, go blocks are always compiled as normal Clojure
58+ code to be run on vthreads and will throw at runtime if vthreads are
59+ not available (Java <21)
6060
6161\" avoid\" - means that vthreads will not be used by core.async - you can
6262use this to minimize impacts if you are not yet ready to utilize vthreads
@@ -558,9 +558,12 @@ IOC and vthread code.
558558 (if (not (dispatch/target-vthreads? ))
559559 (do (require-fresh 'clojure.core.async.impl.go)
560560 ((find-var 'clojure.core.async.impl.go/go-impl) &env body))
561- `(do ~(when clojure.core/*compile-files*
562- `(dispatch/ensure-runtime-vthreads!))
563- (thread-call (^:once fn* [] ~@body) :io ))))
561+ (if (and (not (dispatch/vthreads-available-and-allowed? ))
562+ (not clojure.core/*compile-files*))
563+ (do (dispatch/ensure-runtime-vthreads! )
564+ `(thread-call (^:once fn* [] ~@body) :io ))
565+ `(do (dispatch/ensure-runtime-vthreads! )
566+ (thread-call (^:once fn* [] ~@body) :io )))))
564567
565568(defonce ^:private thread-macro-executor nil )
566569
0 commit comments