2
0
mirror of synced 2025-02-24 14:48:27 +00:00

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

View File

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