SCHED_IDLE and SCHED_BATCH can only be used with sched_priority 0

The function was randomly failing to drop the priority, because the
field was not initialized - it was random garbage instead of 0, leading
to EINVAL.
This commit is contained in:
Lauri Kasanen 2014-01-14 19:20:16 +02:00
parent cf573d03ff
commit c184d91d2c

View file

@ -47,6 +47,7 @@
static inline void drop_policy(void) static inline void drop_policy(void)
{ {
struct sched_param param; struct sched_param param;
param.sched_priority = 0;
#ifdef SCHED_IDLE #ifdef SCHED_IDLE
if (unlikely(sched_setscheduler(0, SCHED_IDLE, &param) == -1)) if (unlikely(sched_setscheduler(0, SCHED_IDLE, &param) == -1))