summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-11-09 10:17:45 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-11-22 09:21:03 (GMT)
commit89fc2b639ac03fd851dc3a70cdbc530592a700cb (patch)
treeadf914ef640a2f1e7a6fadbb840f9d390b22087a
parent1ab855cd61581a073da86d2c64be0b889f004327 (diff)
downloadQt-89fc2b639ac03fd851dc3a70cdbc530592a700cb.zip
Qt-89fc2b639ac03fd851dc3a70cdbc530592a700cb.tar.gz
Qt-89fc2b639ac03fd851dc3a70cdbc530592a700cb.tar.bz2
Compile on OpenBSD
Fail to compile since f3405a516ac30fc7dee1 Reviewed-by: Joao
-rw-r--r--src/corelib/thread/qthread_unix.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index a44a0e8..e3b587d 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -97,6 +97,11 @@
# define SCHED_IDLE 5
#endif
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#define QT_HAS_THREAD_PRIORITY_SCHEDULING
+#endif
+
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_THREAD
@@ -503,6 +508,7 @@ void QThread::usleep(unsigned long usecs)
thread_sleep(&ti);
}
+#ifdef QT_HAS_THREAD_PRIORITY_SCHEDULING
// 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
@@ -533,6 +539,7 @@ static bool calculateUnixPriority(int priority, int *sched_policy, int *sched_pr
*sched_priority = prio;
return true;
}
+#endif
void QThread::start(Priority priority)
{
@@ -553,7 +560,7 @@ void QThread::start(Priority priority)
d->priority = priority;
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && !defined(Q_OS_SYMBIAN) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#if defined(QT_HAS_THREAD_PRIORITY_SCHEDULING) && !defined(Q_OS_SYMBIAN)
// ### Need to implement thread sheduling and priorities for symbian os. Implementation removed for now
switch (priority) {
case InheritPriority:
@@ -594,7 +601,7 @@ void QThread::start(Priority priority)
break;
}
}
-#endif // _POSIX_THREAD_PRIORITY_SCHEDULING
+#endif // QT_HAS_THREAD_PRIORITY_SCHEDULING
#ifdef Q_OS_SYMBIAN
if (d->stackSize == 0)
@@ -757,7 +764,7 @@ void QThread::setPriority(Priority priority)
// copied from start() with a few modifications:
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#ifdef QT_HAS_THREAD_PRIORITY_SCHEDULING
int sched_policy;
sched_param param;