summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qthread_unix.cpp')
-rw-r--r--src/corelib/thread/qthread_unix.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index a7601b654a..c796cea351 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -83,7 +83,9 @@
# define old_qDebug qDebug
# undef qDebug
# endif
+#ifndef QT_NO_CORESERVICES
# include <CoreServices/CoreServices.h>
+#endif //QT_NO_CORESERVICES
# ifdef old_qDebug
# undef qDebug
@@ -358,7 +360,7 @@ int QThread::idealThreadCount()
{
int cores = -1;
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(Q_WS_QPA)
// Mac OS X
cores = MPProcessorsScheduled();
#elif defined(Q_OS_HPUX)
@@ -476,6 +478,7 @@ void QThread::usleep(unsigned long usecs)
// Does some magic and calculate the Unix scheduler priorities
// sched_policy is IN/OUT: it must be set to a valid policy before calling this function
// sched_priority is OUT only
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
static bool calculateUnixPriority(int priority, int *sched_policy, int *sched_priority)
{
#ifdef SCHED_IDLE
@@ -503,6 +506,7 @@ static bool calculateUnixPriority(int priority, int *sched_policy, int *sched_pr
*sched_priority = prio;
return true;
}
+#endif
void QThread::start(Priority priority)
{