diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-04-22 13:47:21 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-23 12:43:40 +0000 |
commit | 25d9bf39d9d63710a04a4e8ee7fd89cc234f726b (patch) | |
tree | 31b30cd5504082a017c81f8734b60dfc1e8fd45c /src/corelib | |
parent | da2a5fd136e858740a5db3982f1365c65eaea6b1 (diff) |
Do not access internal allThreads data unlocked
Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ffb5635c1a34d23d85e3cb42310e14a81fa24f6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/thread/qthreadpool.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index 6d258af9df..4aebbcc8cb 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -756,6 +756,7 @@ bool QThreadPool::contains(const QThread *thread) const const QThreadPoolThread *poolThread = qobject_cast<const QThreadPoolThread *>(thread); if (!poolThread) return false; + QMutexLocker locker(&d->mutex); return d->allThreads.contains(const_cast<QThreadPoolThread *>(poolThread)); } |