From 4b71b5c305a9f570e9949bfcb4d2a91867c4587a Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Tue, 1 Feb 2022 19:53:22 +0100 Subject: [PATCH] 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. --- downloadextractthread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/downloadextractthread.cpp b/downloadextractthread.cpp index 6a3604e..19a5a0e 100644 --- a/downloadextractthread.cpp +++ b/downloadextractthread.cpp @@ -56,7 +56,7 @@ DownloadExtractThread::~DownloadExtractThread() { _cancelled = true; _cancelExtract(); - if (!_extractThread->wait(2000)) + if (!_extractThread->wait(10000)) { _extractThread->terminate(); } @@ -106,7 +106,7 @@ void DownloadExtractThread::_cancelExtract() _queue.clear(); _queue.push_back(QByteArray()); lock.unlock(); - _cv.notify_one(); + _cv.notify_all(); } void DownloadExtractThread::cancelDownload()