deadlock fix
This commit is contained in:
@@ -66,10 +66,10 @@ func (rc *RecConn) setIsConnected(state bool) {
|
|||||||
// Close closes the underlying network connection without
|
// Close closes the underlying network connection without
|
||||||
// sending or waiting for a close frame.
|
// sending or waiting for a close frame.
|
||||||
func (rc *RecConn) Close() {
|
func (rc *RecConn) Close() {
|
||||||
rc.mu.RLock()
|
|
||||||
defer rc.mu.RUnlock()
|
|
||||||
if rc.Conn != nil {
|
if rc.Conn != nil {
|
||||||
|
rc.mu.RLock()
|
||||||
rc.Conn.Close()
|
rc.Conn.Close()
|
||||||
|
rc.mu.RUnlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.setIsConnected(false)
|
rc.setIsConnected(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user