peer: allow msgConsumers to also exit on peer quit send

This commit is contained in:
Olaoluwa Osuntokun committed 2018-08-25 17:30:07 -07:00
1 parent 33c5c9661e
commit 5130949604
1 file changed
+4
+4
View File
@@ -753,6 +753,8 @@ func (ms *msgStream) msgConsumer() {
// Otherwise, we'll check the message queue for any new
// items.
select {
case <-ms.peer.quit:
return
case <-ms.quit:
ms.msgCond.L.Unlock()
return
@@ -777,6 +779,8 @@ func (ms *msgStream) msgConsumer() {
// grow indefinitely.
select {
case ms.producerSema <- struct{}{}:
case <-ms.peer.quit:
return
case <-ms.quit:
return
}