]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Lock now required around missinggo.Event variables
authorMatt Joiner <anacrolix@gmail.com>
Mon, 9 May 2016 06:44:06 +0000 (16:44 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 9 May 2016 06:44:06 +0000 (16:44 +1000)
t.go

diff --git a/t.go b/t.go
index afc8feb29e76fd1733ef5732b578ca0fd35b9d2e..4a0f65adcf0836e35e4f65f34497ba220132699e 100644 (file)
--- a/t.go
+++ b/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
 // has become available.
 func (t *Torrent) GotInfo() <-chan struct{} {
+       t.cl.mu.Lock()
+       defer t.cl.mu.Unlock()
        return t.gotMetainfo.C()
 }