diff options
author | axis <qt-info@nokia.com> | 2010-09-23 11:38:04 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-09-23 12:37:30 (GMT) |
commit | 8d8d147f1dd5d2922a4c61c43d378c8784224f13 (patch) | |
tree | 5a9570108c9af3b8e3697848eb05b7fb17390282 /tests/auto/qtimer/tst_qtimer.cpp | |
parent | 5c29d5be5197b265f16c4895776e9be97db845d6 (diff) | |
download | Qt-8d8d147f1dd5d2922a4c61c43d378c8784224f13.zip Qt-8d8d147f1dd5d2922a4c61c43d378c8784224f13.tar.gz Qt-8d8d147f1dd5d2922a4c61c43d378c8784224f13.tar.bz2 |
Fixed event starvation on Symbian if timers were constantly recreated
If a timer event occurred, and inside its handler a new timer was
created that would also immediately occur, the events would execute
over and over and starve other events. This happened because the code
in Symbian that is supposed to detect when the same event happens
more than once does not work if it is always a new timer which
executes.
The bug was fixed by introducing a state variable which signals
whether we are currently inside the handler of a timer event, and
then pretending that newly created timers inside this handler have
already been executed once, thereby delaying their execution until
the next iteration.
Because we reset the state variable in processEvents, the behavior
will be slightly different if run directly under
CActiveScheduler::Start(). There, we have no way of resetting the
state on the next iteration, so all timers inside such a handler
(even if it recurses into a new CActiveScheduler::Start()) will be
delayed by one event iteration. However, this is considered
acceptable, since there is no real "iteration count" in the active
scheduler; the event will simply be run after the deferred queue is
reactivated (which will be immediately if there are no other events).
This is the same as what would have happened for a real timer that
executed once and then recursed into CActiveScheduler::Start() (it
would also be delayed by one iteration).
Task: QTBUG-13773
RevBy: mread
AutoTest: Passed
Diffstat (limited to 'tests/auto/qtimer/tst_qtimer.cpp')
-rw-r--r-- | tests/auto/qtimer/tst_qtimer.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index 73179fd..102308e 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -719,10 +719,6 @@ void DontBlockEvents::paintEvent() void tst_QTimer::QTBUG13633_dontBlockEvents() { -#ifdef Q_OS_SYMBIAN - QEXPECT_FAIL("", "Expect failure because of QTBUG-13773", Abort); - QVERIFY2(false, "This test hangs on Symbian"); -#endif DontBlockEvents t; QTest::qWait(60); QVERIFY(t.total > 2); |