2
0
mirror of synced 2025-02-24 14:48:27 +00:00

Mark piece complete without Client lock

This commit is contained in:
Matt Joiner 2020-11-14 22:53:55 +11:00
parent 0d40c4bac2
commit 6cceb5749d

View File

@ -1748,10 +1748,16 @@ func (t *Torrent) pieceHashed(piece pieceIndex, passed bool, hashIoErr error) {
c._stats.incrementPiecesDirtiedGood()
}
t.clearPieceTouchers(piece)
t.cl.unlock()
err := p.Storage().MarkComplete()
if err != nil {
t.logger.Printf("%T: error marking piece complete %d: %s", t.storage, piece, err)
}
t.cl.lock()
if t.closed.IsSet() {
return
}
t.pendAllChunkSpecs(piece)
} else {
if len(p.dirtiers) != 0 && p.allChunksDirty() && hashIoErr == nil {