use rlock for error notification

This commit is contained in:
xtaci
2020-09-30 19:04:24 +08:00
parent 608bd97d7b
commit 1a84985373
+2 -2
View File
@@ -858,11 +858,11 @@ func (l *Listener) notifyReadError(err error) {
close(l.chSocketReadError)
// propagate read error to all sessions
l.sessionLock.Lock()
l.sessionLock.RLock()
for _, s := range l.sessions {
s.notifyReadError(err)
}
l.sessionLock.Unlock()
l.sessionLock.RUnlock()
})
}