We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaacbca commit 5b5dde9Copy full SHA for 5b5dde9
peer/channel.go
@@ -106,6 +106,10 @@ func (c *Channel) init() {
106
// write operations to block once the threshold is set.
107
c.dc.SetBufferedAmountLowThreshold(bufferedAmountLowThreshold)
108
c.dc.OnBufferedAmountLow(func() {
109
+ // Grab the lock to protect the sendMore channel from being
110
+ // closed in between the isClosed check and the send.
111
+ c.closeMutex.Lock()
112
+ defer c.closeMutex.Unlock()
113
if c.isClosed() {
114
return
115
}
0 commit comments