Broadcast on sending to an empty channel in case multiple threads are waiting.

Fixes issue #240.
This commit is contained in:
Alex Shinn 2014-10-20 08:28:07 +09:00
parent 843943719a
commit 88506ca53e

View file

@ -26,7 +26,7 @@
(set-cdr! rear new)) (set-cdr! rear new))
(else ; sending to empty channel (else ; sending to empty channel
(channel-front-set! chan new) (channel-front-set! chan new)
(condition-variable-signal! (channel-condvar chan))))) (condition-variable-broadcast! (channel-condvar chan)))))
(mutex-unlock! (channel-mutex chan))) (mutex-unlock! (channel-mutex chan)))
(define (channel-receive! chan) (define (channel-receive! chan)