From eae8faabed151fd32219f2f333fb632c104c73a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 9 Jan 2013 13:12:50 +0200 Subject: Use sched_get_priority_* functions only for SCHED_RR and SCHED_FIFO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In VxWorks set default values for scheduling priority to use SCHED_FIFO_HIGH_PRI and SCHED_FIFO_LOW_PRI defines for other scheduling policies than SCHED_RR or SCHED_FIFO. Change-Id: If78b84cd9ef94d7712206e9442e96cdba727610f Reviewed-by: Samuel Rødal --- src/corelib/thread/qthread_unix.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 3b8a3f383b..3fd95dc7cb 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -488,8 +488,20 @@ static bool calculateUnixPriority(int priority, int *sched_policy, int *sched_pr #endif const int highestPriority = QThread::TimeCriticalPriority; - int prio_min = sched_get_priority_min(*sched_policy); - int prio_max = sched_get_priority_max(*sched_policy); + int prio_min; + int prio_max; +#if defined(Q_OS_VXWORKS) && defined(VXWORKS_DKM) + // for other scheduling policies than SCHED_RR or SCHED_FIFO + prio_min = SCHED_FIFO_LOW_PRI; + prio_max = SCHED_FIFO_HIGH_PRI; + + if ((*sched_policy == SCHED_RR) || (*sched_policy == SCHED_FIFO)) +#endif + { + prio_min = sched_get_priority_min(*sched_policy); + prio_max = sched_get_priority_max(*sched_policy); + } + if (prio_min == -1 || prio_max == -1) return false; -- cgit v1.2.3