summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-12-21 20:47:08 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-28 23:28:05 +0100
commita891ef69201e3c7c7b1090a1315db4c91b8809f5 (patch)
treefb4af3d4894bb68699646aab7f5b425d77f81e7d /src/corelib
parent7b54571ec2032628ea71b0af2d65c97b67dd50e0 (diff)
Don't use MPProcessorsScheduled on Mac OS X
It's deprecated and it's not available on iOS anyway. The recommended way of getting the number of processors online is via sysctl or sysconf (both of which are just slightly below). qthread_unix.cpp:397:13: error: 'MPProcessorsScheduled' is deprecated: first deprecated in Mac OS X 10.7 [-Werror,-Wdeprecated-declarations] Change-Id: I4bf60985fbde155b78b840f3de3ff0a142b78b19 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qthread_unix.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index b80653c07e..3b8a3f383b 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -392,10 +392,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
{
int cores = -1;
-#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
- // Mac OS X
- cores = MPProcessorsScheduled();
-#elif defined(Q_OS_HPUX)
+#if defined(Q_OS_HPUX)
// HP-UX
struct pst_dynamic psd;
if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1) {
@@ -405,7 +402,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
cores = (int)psd.psd_proc_cnt;
}
#elif defined(Q_OS_BSD4)
- // FreeBSD, OpenBSD, NetBSD, BSD/OS
+ // FreeBSD, OpenBSD, NetBSD, BSD/OS, Mac OS X
size_t len = sizeof(cores);
int mib[2];
mib[0] = CTL_HW;