Skip to content

Commit ff876f6

Browse files
committed
Make sure to release lock when acquiring and connection is closed.
Closes #205
1 parent c62c0dc commit ff876f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

conn_notjs.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,11 @@ func (m *mu) lock(ctx context.Context) error {
245245
case m.ch <- struct{}{}:
246246
// To make sure the connection is certainly alive.
247247
// As it's possible the send on m.ch was selected
248-
// the receive on closed.
248+
// over the receive on closed.
249249
select {
250250
case <-m.c.closed:
251+
// Make sure to release.
252+
m.unlock()
251253
return m.c.closeErr
252254
default:
253255
}

0 commit comments

Comments
 (0)