Lock now required around missinggo.Event variables

This commit is contained in:
Matt Joiner 2016-05-09 16:44:06 +10:00
parent a45a09b877
commit c4a6f66a95
1 changed files with 2 additions and 0 deletions

2
t.go
View File

@ -18,6 +18,8 @@ func (t *Torrent) InfoHash() metainfo.Hash {
// Returns a channel that is closed when the info (.Info()) for the torrent
// has become available.
func (t *Torrent) GotInfo() <-chan struct{} {
t.cl.mu.Lock()
defer t.cl.mu.Unlock()
return t.gotMetainfo.C()
}