Skip to content

Commit

Permalink
Merge pull request #56 from kaizsv/master
Browse files Browse the repository at this point in the history
bitmap: Fix idle thread not performing context switch
  • Loading branch information
jserv authored Mar 24, 2018
2 parents 6aaed00 + 824cdeb commit 8089111
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/sched/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ static int sched_bitmap_elect(int flags)
if (flags == SCHED_OPT_RESTORE_ONLY)
thread_restore(next); // switch_to_restore_only
else {
if (next == thread_idle || next == current)
return 0;
if (flags == SCHED_OPT_TICK) {
if (flags == SCHED_OPT_TICK && current != thread_idle) {
thread_enqueue(current, sched_struct.expire);
current->ti_state = THREAD_STATE_EXPIRED;
}
if (next == current)
return 0;
switch_to(next, current);
}

Expand Down

0 comments on commit 8089111

Please sign in to comment.