summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_win.cpp
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2020-04-10 19:49:41 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2020-04-17 06:36:03 +0000
commit6ce4c7d002b6b0ba77416c3b924acdcc4414c0da (patch)
treef5a230b60ee988f9164e55302a02aa851d0cac63 /src/corelib/kernel/qeventdispatcher_win.cpp
parentfd550c943ff5f5c744afee5125956e924dd9e027 (diff)
QEventDispatcherWin32: relax memory ordering on setting wakeUps flag
There is no need in 'acquire' operation for the next reasons: - wakeUps is simply used as an atomic boolean that does not require ordering with other loads or stores; - any of testAndSet...() always gets a latest version of wakeUps. Change-Id: Ica38fc62bc181166995946dee9d6887c71d87cec Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_win.cpp')
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index e841919600..d9b9d84e41 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -971,7 +971,7 @@ int QEventDispatcherWin32::remainingTime(int timerId)
void QEventDispatcherWin32::wakeUp()
{
Q_D(QEventDispatcherWin32);
- if (d->internalHwnd && d->wakeUps.testAndSetAcquire(0, 1)) {
+ if (d->internalHwnd && d->wakeUps.testAndSetRelaxed(0, 1)) {
// post a WM_QT_SENDPOSTEDEVENTS to this thread if there isn't one already pending
if (!PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0))
qErrnoWarning("QEventDispatcherWin32::wakeUp: Failed to post a message");