QThread: relax memory semantics from seq_cst on interruptionRequested

Amends a0faf9e23666d4aa26a93d6e9ebf420e71d5e6c2.

Pick-to: 6.7
Change-Id: I262c3499666e4f4fbcfbfffd17cb1e141ad104d8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Thiago Macieira 2024-04-30 10:12:34 -07:00
parent 5344f784ed
commit b2c236792c
2 changed files with 4 additions and 4 deletions

View File

@ -365,7 +365,7 @@ void QThreadPrivate::finish(void *arg)
d->running = false;
d->finished = true;
d->interruptionRequested = false;
d->interruptionRequested.store(false, std::memory_order_relaxed);
d->isInFinish = false;
d->data->threadId.storeRelaxed(nullptr);
@ -642,7 +642,7 @@ void QThread::start(Priority priority)
d->finished = false;
d->returnCode = 0;
d->exited = false;
d->interruptionRequested = false;
d->interruptionRequested.store(false, std::memory_order_relaxed);
pthread_attr_t attr;
pthread_attr_init(&attr);

View File

@ -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