Calculate the allowable priority for the scheduling policy
#include <sched.h> int sched_get_priority_adjust( int prio, int policy, int adjust );
- The original priority value. If negative, the priority of the calling thread is used.
- The scheduling policy being used. The valid arguments are listed in sched_get_priority_max(). If policy is SCHED_NOCHANGE, the function uses the algorithm of the calling thread.
- The priority change, relative to prio. A value of +10 results in a final priority of prio+10, provided that this amount of adjustment is allowed.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The sched_get_priority_adjust() function calculates the requested priority change relative to another thread and returns the allowable value.
This function makes it easier for you to set relative priorities in order to ensure proper precedence.
- The value of the policy parameter doesn't represent a defined scheduling policy.