diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-04-22 13:47:21 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-04-23 14:43:28 +0200 |
commit | ffb5635c1a34d23d85e3cb42310e14a81fa24f6e (patch) | |
tree | 7530993976030fdfcdbb7c552bbe9505c4ce2af1 /src/corelib/thread | |
parent | f4e23bf3deb69131f78eb78a1cb06da0fe72d9d4 (diff) |
Do not access internal allThreads data unlocked
Pick-to: 6.1 6.0 5.15
Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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 b3e429e25c..9a4e40ee16 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)); } |