Skip to content

Commit

Permalink
fixup! core/sched: add sched_change_priority() function
Browse files Browse the repository at this point in the history
  • Loading branch information
maribu committed Nov 2, 2021
1 parent a9249ee commit 694f1a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,13 @@ void sched_change_priority(thread_t *thread, uint8_t priority)
return;
}

unsigned irq_state = irq_disable();
if (thread_is_active(thread)) {
_runqueue_pop(thread);
_runqueue_push(thread, priority);
}

thread->priority = priority;
irq_restore(irq_state);

thread_t *active = thread_get_active();
if ((active == thread)
Expand Down

0 comments on commit 694f1a6

Please sign in to comment.