Torrent.Stats: RLock instead of Lock

This commit is contained in:
Matt Joiner 2018-06-16 16:38:14 +10:00
parent 70dfc1f518
commit 0f90af85f1
1 changed files with 2 additions and 2 deletions

View File

@ -1436,8 +1436,8 @@ func (t *Torrent) addPeers(peers []Peer) {
}
func (t *Torrent) Stats() TorrentStats {
t.cl.mu.Lock()
defer t.cl.mu.Unlock()
t.cl.mu.RLock()
defer t.cl.mu.RUnlock()
return t.statsLocked()
}