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:
parent
cf573d03ff
commit
c184d91d2c
1 changed files with 1 additions and 0 deletions
|
@ -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, ¶m) == -1))
|
if (unlikely(sched_setscheduler(0, SCHED_IDLE, ¶m) == -1))
|
||||||
|
|
Loading…
Reference in a new issue