summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_win.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-10-06 13:09:57 +0200
committerAndré Hartmann <aha_1980@gmx.de>2017-10-15 16:14:04 +0000
commitb5f2bf1a71d926b9bb04101b49a11fd641aad14f (patch)
tree664a311cc457f10d94f6cdb82500b0a32c33f5a5 /src/corelib/kernel/qeventdispatcher_win.cpp
parent1a039e89beecacaaf55c65e4e4cad5eaf94bb1a0 (diff)
Fix QWinEventNotifier for auto-reset events
Auto-reset events are automatically reset to non-signaled when we get notified about the signaled state. This implies that we cannot check the event state again in activateEventNotifiers. Instead, store the signaled state in a QAtomicInt and test and decrement that. This amends commit 85403d0a. Task-number: QTBUG-63555 Change-Id: I0adee3d2929783f98d91060f9106c8b5266d72fa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_win.cpp')
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 569fbc2796..bbd442d570 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -942,7 +942,8 @@ void QEventDispatcherWin32::activateEventNotifiers()
for (int i = d->winEventNotifierList.count(); --i >= 0;) {
QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
- if (WaitForSingleObject(nd->handleToEvent, 0) == WAIT_OBJECT_0) {
+ if (nd->signaledCount.load() != 0) {
+ --nd->signaledCount;
nd->unregisterWaitObject();
d->activateEventNotifier(notifier);
}