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

Lines changed: 3 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy