summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-10 23:18:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-10 23:18:00 (GMT)
commitfcdf5a5471b7cf1d2bc72855ed1f627c8d6f4fc4 (patch)
tree9859d21d69c2d510f86316ff9ef3bd3da4972be0 /src/corelib
parentd50278c22bf748691719abfd2837f96deabda033 (diff)
parent2ecb0ea77c04424f6f557ca8a13c1d86666763df (diff)
downloadQt-fcdf5a5471b7cf1d2bc72855ed1f627c8d6f4fc4.zip
Qt-fcdf5a5471b7cf1d2bc72855ed1f627c8d6f4fc4.tar.gz
Qt-fcdf5a5471b7cf1d2bc72855ed1f627c8d6f4fc4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Fix for major regression in OpenVG clipping Cast int to HALData::TAttribute for QT_HALData_ENumCpus and compile with RVCT4. Don't use EGL surfaces for translucency with 32MB GPU chip. Fix for fromSymbianCFbsBitmap changing the source data unexpectedly. Background app visible after split view closed Get the number of cores from HAL on Symbian. Avoid image conversion in fromSymbianCFbsBitmap for certain formats. Polish splitview implementation QML app: text input field is not visible when split view is opened Visible flashing on QML app when split view is opened and closed
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qthread_unix.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 5177339..c2bc895 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -54,6 +54,11 @@
#include <private/qeventdispatcher_unix_p.h>
#endif
+#ifdef Q_OS_SYMBIAN
+#include <hal.h>
+#include <hal_data.h>
+#endif
+
#include "qthreadstorage.h"
#include "qthread_p.h"
@@ -63,6 +68,12 @@
#include <sched.h>
#include <errno.h>
+// You only find these enumerations on Symbian^3 onwards, so we need to provide our own
+// to remain compatible with older releases. They won't be called by pre-Sym^3 SDKs.
+
+// HALData::ENumCpus
+#define QT_HALData_ENumCpus 119
+
#ifdef Q_OS_BSD4
#include <sys/sysctl.h>
#endif
@@ -422,8 +433,20 @@ int QThread::idealThreadCount()
// as of aug 2008 Integrity only supports one single core CPU
cores = 1;
#elif defined(Q_OS_SYMBIAN)
- // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported
- cores = 1;
+ if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_3) {
+ TInt inumcpus;
+ TInt err;
+ err = HAL::Get((HALData::TAttribute)QT_HALData_ENumCpus, inumcpus);
+ if (err != KErrNone) {
+ cores = 1;
+ } else if ( inumcpus <= 0 ) {
+ cores = 1;
+ } else {
+ cores = inumcpus;
+ }
+ } else {
+ cores = 1;
+ }
#elif defined(Q_OS_VXWORKS)
// VxWorks
# if defined(QT_VXWORKS_HAS_CPUSET)