From: Matt Joiner Date: Mon, 9 May 2016 06:44:06 +0000 (+1000) Subject: Lock now required around missinggo.Event variables X-Git-Tag: v1.0.0~739 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=c4a6f66a95ea53098d766aabcb74817f90a2c275;p=btrtrc.git Lock now required around missinggo.Event variables --- diff --git a/t.go b/t.go index afc8feb2..4a0f65ad 100644 --- 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() }