File indexing completed on 2025-01-05 04:37:17

0001 /*
0002     SPDX-FileCopyrightText: 2007 Joris Guisson <joris.guisson@gmail.com>
0003     SPDX-FileCopyrightText: 2007 Ivan Vasic <ivasic@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 #include "piecedownloader.h"
0008 
0009 namespace bt
0010 {
0011 PieceDownloader::PieceDownloader()
0012     : grabbed(0)
0013     , nearly_done(false)
0014 {
0015 }
0016 
0017 PieceDownloader::~PieceDownloader()
0018 {
0019 }
0020 
0021 int PieceDownloader::grab()
0022 {
0023     grabbed++;
0024     return grabbed;
0025 }
0026 
0027 void PieceDownloader::release()
0028 {
0029     grabbed--;
0030     if (grabbed < 0)
0031         grabbed = 0;
0032 }
0033 
0034 }
0035 
0036 #include "moc_piecedownloader.cpp"