mirror of
https://github.com/xtaci/kcp-go.git
synced 2024-04-21 12:32:15 +00:00
use rlock for error notification
This commit is contained in:
@@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user