Skip to content

Commit f6b76a6

Browse files
committed
Lock on bufferred amount low
1 parent 5034ca3 commit f6b76a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

peer/channel.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ 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()
108110
if c.isClosed() {
109111
return
110112
}

0 commit comments

Comments
 (0)