File tree Expand file tree Collapse file tree 5 files changed +1065
-1132
lines changed
main/clojure/clojure/core
test/clojure/clojure/core/async Expand file tree Collapse file tree 5 files changed +1065
-1132
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ to catch and handle."
27
27
[clojure.core.async.impl.timers :as timers]
28
28
[clojure.core.async.impl.dispatch :as dispatch]
29
29
[clojure.core.async.impl.ioc-macros :as ioc]
30
+ clojure.core.async.impl.go ; ; TODO: make conditional
30
31
[clojure.core.async.impl.mutex :as mutex]
31
32
[clojure.core.async.impl.concurrent :as conc]
32
33
)
@@ -456,18 +457,7 @@ to catch and handle."
456
457
Returns a channel which will receive the result of the body when
457
458
completed"
458
459
[& body]
459
- (let [crossing-env (zipmap (keys &env) (repeatedly gensym))]
460
- `(let [c# (chan 1 )
461
- captured-bindings# (Var/getThreadBindingFrame )]
462
- (dispatch/run
463
- (^:once fn* []
464
- (let [~@(mapcat (fn [[l sym]] [sym `(^:once fn* [] ~(vary-meta l dissoc :tag ))]) crossing-env)
465
- f# ~(ioc/state-machine `(do ~@body) 1 [crossing-env &env] ioc/async-custom-terminators)
466
- state# (-> (f# )
467
- (ioc/aset-all! ioc/USER-START-IDX c#
468
- ioc/BINDINGS-IDX captured-bindings#))]
469
- (ioc/run-state-machine-wrapped state#))))
470
- c#)))
460
+ (#'clojure.core.async.impl.go/go-impl &env body))
471
461
472
462
(defonce ^:private ^Executor thread-macro-executor
473
463
(Executors/newCachedThreadPool (conc/counted-thread-factory " async-thread-macro-%d" true )))
You can’t perform that action at this time.
0 commit comments