From f884ff2160ed5b3c44663d70e1c6915aff4b8ac0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Jan 2022 09:47:28 +0100 Subject: [PATCH] Revert "Avoid starting threads from the wrong hosting thread" This reverts commit 1421694d17d464be59478d573a7873f86b6fd2a2. The commit broke e.g. Utils::mapReduce(....).results() in the main thread. Since the main thread blocks, it cannot start a new thread. Change-Id: I63abd07bcf002546740d0a7627f1fd2007c8b70c Reviewed-by: Allan Sandfeld Jensen --- src/libs/utils/runextensions.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h index 9339f1a52ee..e7b9dd6c939 100644 --- a/src/libs/utils/runextensions.h +++ b/src/libs/utils/runextensions.h @@ -408,10 +408,7 @@ QFuture runAsync_internal(QThreadPool *pool, QFuture future = job->future(); if (pool) { job->setThreadPool(pool); - if (QThread::currentThread() == pool->thread()) - pool->start(job); - else - QMetaObject::invokeMethod(pool, [pool, job]() { pool->start(job); }, Qt::QueuedConnection); + pool->start(job); } else { auto thread = new Internal::RunnableThread(job); if (stackSize)