diff options
| author | BogDan Vatra <bogdan@kde.org> | 2025-08-13 11:32:32 +0300 |
|---|---|---|
| committer | BogDan Vatra <bogdan@kde.org> | 2025-08-21 12:00:37 +0300 |
| commit | 51d04d0917aabdcbac17d67c758b8ccd63f57f85 (patch) | |
| tree | 1b20ecacf6abd7894654ff32de509c207fb11774 /src/corelib/thread/qfutureinterface.h | |
| parent | 5bd9267af7e34d00b4524697bb80dffd1a250df9 (diff) | |
Don't assert if the QFuture is in pending state
Same as result/results takeResult should just waitForResult
Fixes: QTBUG-139119
Pick-to: 6.10 6.9 6.8
Change-Id: Ic578ee6c5853a5b1551f1d30ac9f5e302f79b4e6
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/thread/qfutureinterface.h')
| -rw-r--r-- | src/corelib/thread/qfutureinterface.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h index 01d2f595aeb..0b88013800e 100644 --- a/src/corelib/thread/qfutureinterface.h +++ b/src/corelib/thread/qfutureinterface.h @@ -445,12 +445,11 @@ inline QList<T> QFutureInterface<T>::results() template<typename T> T QFutureInterface<T>::takeResult() { - Q_ASSERT(isValid()); - // Note: we wait for all, this is intentional, // not to mess with other unready results. waitForResult(-1); + Q_ASSERT(isValid()); Q_ASSERT(!hasException()); const QMutexLocker<QMutex> locker{&mutex()}; @@ -466,10 +465,9 @@ T QFutureInterface<T>::takeResult() template<typename T> std::vector<T> QFutureInterface<T>::takeResults() { - Q_ASSERT(isValid()); - waitForResult(-1); + Q_ASSERT(isValid()); Q_ASSERT(!hasException()); std::vector<T> res; |
