From 6ce4c7d002b6b0ba77416c3b924acdcc4414c0da Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 10 Apr 2020 19:49:41 +0300 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qeventdispatcher_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- cgit v1.2.3