diff options
Diffstat (limited to 'src/corelib/thread/qthread_win.cpp')
-rw-r--r-- | src/corelib/thread/qthread_win.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 475a61bf65..74bc1d2650 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -87,8 +87,8 @@ QThreadData *QThreadData::current(bool createIfNecessary) threadData->isAdopted = true; threadData->threadId.storeRelaxed(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()))); - if (!QCoreApplicationPrivate::theMainThread) { - QCoreApplicationPrivate::theMainThread = threadData->thread.loadRelaxed(); + if (!QCoreApplicationPrivate::theMainThreadId) { + QCoreApplicationPrivate::theMainThread.storeRelease(threadData->thread.loadRelaxed()); QCoreApplicationPrivate::theMainThreadId.storeRelaxed(threadData->threadId.loadRelaxed()); } else { HANDLE realHandle = INVALID_HANDLE_VALUE; @@ -314,7 +314,7 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway) noexcept d->running = false; d->finished = true; d->isInFinish = false; - d->interruptionRequested = false; + d->interruptionRequested.store(false, std::memory_order_relaxed); if (!d->waiters) { CloseHandle(d->handle); @@ -391,7 +391,7 @@ void QThread::start(Priority priority) d->finished = false; d->exited = false; d->returnCode = 0; - d->interruptionRequested = false; + d->interruptionRequested.store(false, std::memory_order_relaxed); /* NOTE: we create the thread in the suspended state, set the |