Lock now required around missinggo.Event variables
This commit is contained in:
parent
a45a09b877
commit
c4a6f66a95
2
t.go
2
t.go
|
@ -18,6 +18,8 @@ func (t *Torrent) InfoHash() metainfo.Hash {
|
||||||
// Returns a channel that is closed when the info (.Info()) for the torrent
|
// Returns a channel that is closed when the info (.Info()) for the torrent
|
||||||
// has become available.
|
// has become available.
|
||||||
func (t *Torrent) GotInfo() <-chan struct{} {
|
func (t *Torrent) GotInfo() <-chan struct{} {
|
||||||
|
t.cl.mu.Lock()
|
||||||
|
defer t.cl.mu.Unlock()
|
||||||
return t.gotMetainfo.C()
|
return t.gotMetainfo.C()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue