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 19:16:49 +0000 |
commit | 390bf93dd70925a959db6c3da5fd5323f8e9adca (patch) | |
tree | 4621e3ed76160e917fb689faa8ea952095f70054 /src/corelib/thread | |
parent | f21a3a451ff531fc1ed6bcf24a188db49fc02cd2 (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/thread')
-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 d62efbadfa..14d7acffb2 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -788,6 +788,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)); } |