aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2022-01-18 09:47:28 +0100
committerEike Ziller <eike.ziller@qt.io>2022-01-18 09:06:50 +0000
commitf884ff2160ed5b3c44663d70e1c6915aff4b8ac0 (patch)
treebf7190a8147645d2829b3d163f9a21ead2684d64
parent62c36f516bb9795058a4bff7cfa9ecdcedd182a7 (diff)
Revert "Avoid starting threads from the wrong hosting thread"v6.0.2
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 <allan.jensen@qt.io>
-rw-r--r--src/libs/utils/runextensions.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h
index 9339f1a52e..e7b9dd6c93 100644
--- a/src/libs/utils/runextensions.h
+++ b/src/libs/utils/runextensions.h
@@ -408,10 +408,7 @@ QFuture<ResultType> runAsync_internal(QThreadPool *pool,
QFuture<ResultType> 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)