Skip to content

Commit c7ddc64

Browse files
committed
Fix bug in channels -- all ioc_macros-test tests now run!
1 parent 22e01bf commit c7ddc64

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
(when-not (= (.Count puts) 0)
6868
(loop [curr-node (.First puts)
6969
next-node (.Next curr-node)] ;; curr-node not null at init because count is not 0
70-
(when-not (impl/active? (.Value curr-node))
70+
(when-not (impl/active? (first (.Value curr-node)))
7171
(.Remove puts curr-node))
7272
(when next-node
7373
(recur next-node (.Next next-node))))))
@@ -123,7 +123,7 @@
123123
(let ;;; [iter (.iterator takes)
124124
;;; take-cbs (loop [takers []]
125125
;;; (if (and (.hasNext iter) (pos? (count buf)))
126-
;;; (let [^Lock taker (.hasNext iter)]
126+
;;; (let [^Lock taker (.next iter)]
127127
;;; (.lock taker)
128128
;;; (let [ret (and (impl/active? taker) (impl/commit taker))]
129129
;;; (.unlock taker)
@@ -188,16 +188,16 @@
188188
(do (.lock handler) (.lock taker))
189189
(do (.lock taker) (.lock handler)))
190190
(let [ret (when (and (impl/active? handler) (impl/active? taker))
191-
[(impl/commit handler) (impl/commit taker)])]
191+
[(impl/commit handler) (impl/commit taker)])
192+
next-node (.Next curr-node)]
192193
(.unlock handler)
193194
(.unlock taker)
194195
(if ret
195196
(do
196197
(.Remove takes curr-node)
197198
ret)
198-
(let [next-node (.Next curr-node)]
199-
(when next-node
200-
(recur next-node (.Value next-node))))))))]
199+
(when next-node
200+
(recur next-node (.Value next-node)))))))]
201201

202202
(if (and put-cb take-cb)
203203
(do

0 commit comments

Comments
 (0)