File tree Expand file tree Collapse file tree 2 files changed +0
-28
lines changed
src/main/clojure/clojure/core/async/impl Expand file tree Collapse file tree 2 files changed +0
-28
lines changed Original file line number Diff line number Diff line change 19
19
[clojure.tools.analyzer.passes.jvm.annotate-loops :refer [annotate-loops]]
20
20
[clojure.tools.analyzer.passes.jvm.warn-on-reflection :refer [warn-on-reflection]]
21
21
[clojure.tools.analyzer.jvm :as an-jvm]
22
- [clojure.core.async.impl.protocols :as impl]
23
22
[clojure.core.async.impl.runtime :as rt]
24
23
[clojure.set :as set])
25
24
(:import [java.util.concurrent.atomic AtomicReferenceArray]))
Original file line number Diff line number Diff line change 85
85
:recur )
86
86
nil ))
87
87
88
- (defn run-state-machine [state]
89
- ((aget-object state FN-IDX) state))
90
-
91
- (defn run-state-machine-wrapped [state]
92
- (try
93
- (run-state-machine state)
94
- (catch Throwable ex
95
- (impl/close! (aget-object state USER-START-IDX))
96
- (throw ex))))
97
-
98
- (defn take! [state blk c]
99
- (if-let [cb (impl/take! c (fn-handler
100
- (fn [x]
101
- (aset-all! state VALUE-IDX x STATE-IDX blk)
102
- (run-state-machine-wrapped state))))]
103
- (do (aset-all! state VALUE-IDX @cb STATE-IDX blk)
104
- :recur )
105
- nil ))
106
-
107
- (defn put! [state blk c val]
108
- (if-let [cb (impl/put! c val (fn-handler (fn [ret-val]
109
- (aset-all! state VALUE-IDX ret-val STATE-IDX blk)
110
- (run-state-machine-wrapped state))))]
111
- (do (aset-all! state VALUE-IDX @cb STATE-IDX blk)
112
- :recur )
113
- nil ))
114
-
115
88
(defn return-chan [state value]
116
89
(let [c (aget-object state USER-START-IDX)]
117
90
(when-not (nil? value)
You can’t perform that action at this time.
0 commit comments