t.go | 4 ++-- diff --git a/t.go b/t.go index b42a3f0f2c1c29f0ec9d2bbf5f19f6c2aca135ce..3f65d48ba88f76521d4ac3bdea42164024d79646 100644 --- a/t.go +++ b/t.go @@ -180,8 +180,8 @@ // priority. Piece indexes are not the same as bytes. Requires that the info // has been obtained, see Torrent.Info and Torrent.GotInfo. func (t *Torrent) DownloadPieces(begin, end pieceIndex) { t.cl.lock() - defer t.cl.unlock() t.downloadPiecesLocked(begin, end) + t.cl.unlock() } func (t *Torrent) downloadPiecesLocked(begin, end pieceIndex) { @@ -194,8 +194,8 @@ } func (t *Torrent) CancelPieces(begin, end pieceIndex) { t.cl.lock() - defer t.cl.unlock() t.cancelPiecesLocked(begin, end) + t.cl.unlock() } func (t *Torrent) cancelPiecesLocked(begin, end pieceIndex) {