summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-09-27 13:54:41 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-28 11:42:25 +0000
commit34a3885feb301aa0f9413f8246a0838f5ef295f2 (patch)
treec5d151d87fa9f5cb96e1220abf38dff57b187c17 /src
parent8d445e6c73f2fe981eb8da0e647d21cca1ba4fc2 (diff)
QThread: Remove superfluous initialization of threadId on Unix
The thread ID is already initialized inside QThread::start() while the thread lock is taken. This is completed before the attempted initialization in QThreadPrivate::start() because it tries to take the same lock. Task-number: QTBUG-96846 Change-Id: Ic9588f3e2e2f3c2180afbed8ec01155b33043eb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 05870db7d0606e0a64115a523bf1366137f34700) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/thread/qthread_unix.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 205ae50035..66a48932ef 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -300,7 +300,9 @@ void *QThreadPrivate::start(void *arg)
thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag));
}
- data->threadId.storeRelaxed(to_HANDLE(pthread_self()));
+ // threadId is set in QThread::start()
+ Q_ASSERT(pthread_equal(from_HANDLE<pthread_t>(data->threadId.loadRelaxed()),
+ pthread_self()));
set_thread_data(data);
data->ref();