summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@theqtcompany.com>2016-03-16 10:32:44 +0100
committerMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-03-16 10:26:16 +0000
commit7e72a5e11e92ed1df28ed34b13b711df6ca6fde2 (patch)
treead22b6282d24f85cfd7540e3658f9730b8d429fd /src/corelib
parent9c3c350627c1fc9d7f6e063f9360b096f159a6d7 (diff)
winrt: process all triggered timers in processEvents
If only one timer is processed in there it is possible that a reoccuring timer which has a very low timeout blocks all the other timers from being triggered. This high frequency timer might be the only one to be triggered in every processEvents call. Task-number: QTBUG-51888 Change-Id: I8a0026d1e8519171ab60d1b47c494a15d30328b3 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp
index df070dd1ae..ca4ba72b66 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt.cpp
+++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp
@@ -210,8 +210,10 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
const QVector<HANDLE> timerHandles = d->timerIdToHandle.values().toVector();
if (waitTime)
emit aboutToBlock();
+ bool timerEventsSent = false;
DWORD waitResult = WaitForMultipleObjectsEx(timerHandles.count(), timerHandles.constData(), FALSE, waitTime, TRUE);
- if (waitResult >= WAIT_OBJECT_0 && waitResult < WAIT_OBJECT_0 + timerHandles.count()) {
+ while (waitResult >= WAIT_OBJECT_0 && waitResult < WAIT_OBJECT_0 + timerHandles.count()) {
+ timerEventsSent = true;
const HANDLE handle = timerHandles.value(waitResult - WAIT_OBJECT_0);
ResetEvent(handle);
const int timerId = d->timerHandleToId.value(handle);
@@ -226,12 +228,10 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
// Update timer's targetTime
const quint64 targetTime = qt_msectime() + info.interval;
info.targetTime = targetTime;
- emit awake();
- return true;
+ waitResult = WaitForMultipleObjectsEx(timerHandles.count(), timerHandles.constData(), FALSE, 0, TRUE);
}
emit awake();
-
- if (userEventsSent)
+ if (timerEventsSent || userEventsSent)
return true;
// We cannot wait infinitely like on other platforms, as