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>
This commit is contained in:
Allan Sandfeld Jensen 2021-04-22 13:47:21 +02:00 committed by Qt Cherry-pick Bot
parent e51e5c5840
commit 8e66843087

View File

@ -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));
}