summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-02-17 22:24:03 +0100
committerRichard Braun <rbraun@sceen.net>2018-02-17 22:24:03 +0100
commitc8812e110b3fb23a675957d97d2afa057169c866 (patch)
tree2ebd59fa37b0ca0d4c6a2fe32f3be9600c3ca8f2
parentfd945d5bd48d5501051cda4d1473593cbb662b06 (diff)
thread: fix round-robin scheduling of idle priority threads
-rw-r--r--src/thread.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/thread.c b/src/thread.c
index bb5ddc4..55efbe2 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -410,17 +410,15 @@ static void
thread_runq_tick(struct thread_runq *runq)
{
struct thread_list *list;
+ unsigned int priority;
assert(!cpu_intr_enabled());
assert(!thread_preempt_enabled());
- if (runq->current == runq->idle) {
- return;
- }
-
- list = thread_runq_get_list(runq, runq->current->priority);
+ priority = runq->current->priority;
+ list = thread_runq_get_list(runq, priority);
- if (thread_list_singular(list)) {
+ if (thread_list_singular(list) && (priority != THREAD_IDLE_PRIORITY)) {
return;
}