From 25d9bf39d9d63710a04a4e8ee7fd89cc234f726b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 22 Apr 2021 13:47:21 +0200 Subject: Do not access internal allThreads data unlocked Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0 Reviewed-by: Sona Kurazyan Reviewed-by: Thiago Macieira (cherry picked from commit ffb5635c1a34d23d85e3cb42310e14a81fa24f6e) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/thread/qthreadpool.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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(thread); if (!poolThread) return false; + QMutexLocker locker(&d->mutex); return d->allThreads.contains(const_cast(poolThread)); } -- cgit v1.2.3