2
0
mirror of synced 2025-02-24 06:38:14 +00:00

Add Torrent.Closed

This commit is contained in:
Matt Joiner 2016-11-30 18:02:39 +11:00
parent 9d35196cca
commit af7a0d3464

View File

@ -115,6 +115,11 @@ type Torrent struct {
stats TorrentStats
}
// Returns a channel that is closed when the Torrent is closed.
func (t *Torrent) Closed() <-chan struct{} {
return t.closed.LockedChan(&t.cl.mu)
}
func (t *Torrent) setChunkSize(size pp.Integer) {
t.chunkSize = size
t.chunkPool = &sync.Pool{