summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_unix.cpp
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@digia.com>2013-01-09 13:12:50 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-23 10:38:56 +0100
commiteae8faabed151fd32219f2f333fb632c104c73a7 (patch)
tree55b2155a626be5b3bf6894271e1d5788101eece5 /src/corelib/thread/qthread_unix.cpp
parent00faa09aadfc6c6db9da639ba6b7866c72447e39 (diff)
Use sched_get_priority_* functions only for SCHED_RR and SCHED_FIFO
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 <samuel.rodal@digia.com>
Diffstat (limited to 'src/corelib/thread/qthread_unix.cpp')
-rw-r--r--src/corelib/thread/qthread_unix.cpp16
1 files changed, 14 insertions, 2 deletions
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;