Give extract thread more time to gracefully terminate on cancellation

Embedded build does not deal well with threads being forcefully
terminated.
So wait 10 seconds instead of 2 before resorting to that.
This commit is contained in:
Floris Bos 2022-02-01 19:53:22 +01:00
parent 0f6115e3a5
commit 4b71b5c305

View file

@ -56,7 +56,7 @@ DownloadExtractThread::~DownloadExtractThread()
{ {
_cancelled = true; _cancelled = true;
_cancelExtract(); _cancelExtract();
if (!_extractThread->wait(2000)) if (!_extractThread->wait(10000))
{ {
_extractThread->terminate(); _extractThread->terminate();
} }
@ -106,7 +106,7 @@ void DownloadExtractThread::_cancelExtract()
_queue.clear(); _queue.clear();
_queue.push_back(QByteArray()); _queue.push_back(QByteArray());
lock.unlock(); lock.unlock();
_cv.notify_one(); _cv.notify_all();
} }
void DownloadExtractThread::cancelDownload() void DownloadExtractThread::cancelDownload()