Skip to content

Commit 3ca4a35

Browse files
committed
Fix mutex lock
1 parent f6b76a6 commit 3ca4a35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

peer/channel.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ func (c *Channel) init() {
105105
// write operations to block once the threshold is set.
106106
c.dc.SetBufferedAmountLowThreshold(bufferedAmountLowThreshold)
107107
c.dc.OnBufferedAmountLow(func() {
108-
c.closeMutex.Lock()
109-
defer c.closeMutex.Unlock()
110108
if c.isClosed() {
111109
return
112110
}
113111
select {
112+
case <-c.closed:
113+
return
114114
case c.sendMore <- struct{}{}:
115115
default:
116116
}

0 commit comments

Comments
 (0)