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
Pick-to: 5.15 6.2
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>
This commit is contained in:
Ievgenii Meshcheriakov 2021-09-27 13:54:41 +02:00
parent 416fbfa5a0
commit 05870db7d0

View File

@ -304,7 +304,9 @@ void *QThreadPrivate::start(void *arg)
thr->d_func()->setPriority(QThread::Priority(qToUnderlying(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();