summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthreadpool.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-06-02 10:59:21 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-06-03 18:40:34 +0200
commit87d32424de2f471a520c1f3ba0c3035fbff7ee06 (patch)
treed747902db6df974ef010c90e9ce1b0bd7368260b /src/corelib/thread/qthreadpool.h
parent6a31a7b024679c4dcbcf8120b06db0a17fa219ce (diff)
Do not multithread if already in a global threadpool thread
This can lead to a deadlock if we block all the worker threads, waiting for the worker threads to finish. Pick-to: 5.15 Fixes: QTBUG-84619 Change-Id: I92b7f96007897d86ece0c34223bab0df4ccbed9a Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/thread/qthreadpool.h')
-rw-r--r--src/corelib/thread/qthreadpool.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/thread/qthreadpool.h b/src/corelib/thread/qthreadpool.h
index e3691ab010..004f76a240 100644
--- a/src/corelib/thread/qthreadpool.h
+++ b/src/corelib/thread/qthreadpool.h
@@ -93,6 +93,8 @@ public:
void clear();
+ bool contains(const QThread *thread) const;
+
#if QT_DEPRECATED_SINCE(5, 9)
QT_DEPRECATED_X("use tryTake(), but note the different deletion rules")
void cancel(QRunnable *runnable);