summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@digia.com>2013-01-09 11:12:50 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-28 13:12:10 (GMT)
commitc44a0466636e6bf9e83f9c75deb0d5cad8135e93 (patch)
tree0e64b29c836ae165786fc77e9448560e3aaf562a /src/corelib
parent7139b08695cb96bee600956f0ef4eb8fed05bb10 (diff)
downloadQt-c44a0466636e6bf9e83f9c75deb0d5cad8135e93.zip
Qt-c44a0466636e6bf9e83f9c75deb0d5cad8135e93.tar.gz
Qt-c44a0466636e6bf9e83f9c75deb0d5cad8135e93.tar.bz2
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 (cherry picked from qtbase/eae8faabed151fd32219f2f333fb632c104c73a7) Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/corelib')
-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 4f55b07..22e5297 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -536,8 +536,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;