diff --git a/conn_notjs.go b/conn_notjs.go index 2ec5f5bf9f2a7902b557a5901968b31557b4b205..bb2eb22f7dbad0e22a5b932fbbab50f7381c64ce 100644 --- a/conn_notjs.go +++ b/conn_notjs.go @@ -245,9 +245,11 @@ func (m *mu) lock(ctx context.Context) error { case m.ch <- struct{}{}: // To make sure the connection is certainly alive. // As it's possible the send on m.ch was selected - // the receive on closed. + // over the receive on closed. select { case <-m.c.closed: + // Make sure to release. + m.unlock() return m.c.closeErr default: }