good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit ff876f6d authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Make sure to release lock when acquiring and connection is closed.

Closes #205
parent c62c0dcc
No related branches found
No related tags found
No related merge requests found
......@@ -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:
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment