summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2010-03-25 10:58:57 (GMT)
committermread <qt-info@nokia.com>2010-03-25 11:02:31 (GMT)
commitd7fe2d90fe5a1ac5a29a5bc65eb5657d4d539563 (patch)
tree5102abb6373ddb72dc460dae48b9f591946b0aa4 /src
parent80cf88a395d61c2dee83d484c91f24437be0c0e0 (diff)
downloadQt-d7fe2d90fe5a1ac5a29a5bc65eb5657d4d539563.zip
Qt-d7fe2d90fe5a1ac5a29a5bc65eb5657d4d539563.tar.gz
Qt-d7fe2d90fe5a1ac5a29a5bc65eb5657d4d539563.tar.bz2
Symbian event loop priority drop not used in Symbian^4
The priority drop hack used in the Symbian version of Qt's event dispatcher is not needed from Symbian^4, as the viewsrv panics, which it was designed to prevent, are disabled. This change disables the priority drop code when Qt is compiled in a Symbian^4 environment, using the SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS define as a key. This will improve system and performance predictability, as app priorities will be more stable. It also gives a slight performance boost to app startup in the order of 10ms. Reviewed-by: Jason Barron
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 191be6c..ca44264 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -50,6 +50,13 @@
QT_BEGIN_NAMESPACE
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+// when the system UI is Qt based, priority drop is not needed as CPU starved processes will not be killed.
+#undef QT_SYMBIAN_PRIORITY_DROP
+#else
+#define QT_SYMBIAN_PRIORITY_DROP
+#endif
+
#define WAKE_UP_PRIORITY CActive::EPriorityStandard
#define TIMER_PRIORITY CActive::EPriorityHigh
#define NULLTIMER_PRIORITY CActive::EPriorityLow
@@ -697,6 +704,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
bool handledSymbianEvent = false;
m_interrupt = false;
+#ifdef QT_SYMBIAN_PRIORITY_DROP
/*
* This QTime variable is used to measure the time it takes to finish
* the event loop. If we take too long in the loop, other processes
@@ -714,6 +722,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
} timeState = FirstRun;
TProcessPriority priority;
+#endif
while (1) {
if (block) {
@@ -727,10 +736,12 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
CActiveScheduler::Current()->WaitForAnyRequest();
}
+#ifdef QT_SYMBIAN_PRIORITY_DROP
if (timeState == SubsequentRun) {
time.start();
timeState = TimeStarted;
}
+#endif
TInt error;
handledSymbianEvent = CActiveScheduler::RunIfReady(error, KMinTInt);
@@ -747,6 +758,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
break;
}
block = false;
+#ifdef QT_SYMBIAN_PRIORITY_DROP
if (timeState == TimeStarted && time.elapsed() > 100) {
priority = m_processHandle.Priority();
m_processHandle.SetPriority(EPriorityBackground);
@@ -759,6 +771,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
}
if (timeState == FirstRun)
timeState = SubsequentRun;
+#endif
};
emit awake();