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>
This commit is contained in:
Pasi Petäjäjärvi 2013-01-09 13:12:50 +02:00 committed by The Qt Project
parent 00faa09aad
commit eae8faabed

View File

@ -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;