diff options
author | Ian Moffett <ian@osmora.org> | 2024-02-26 22:51:36 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-02-26 22:51:36 -0500 |
commit | fc453b133f8dcbe6d4953a456ea5f353680914f9 (patch) | |
tree | 5c3be1e0cd5021c2fcb891793272edb41e160787 | |
parent | ef4c895aa1cdb24fd762a65fc468a4bddbd3fb29 (diff) |
kernel: sched: Fix mistake in context switch code
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | sys/kern/kern_sched.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index b964fc5..f61c592 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -171,10 +171,10 @@ sched_context_switch(struct trapframe *tf) struct proc *td, *next_td; /* - * If we only have one thread or even no threads, there is - * no point in preempting. + * If we have no threads, we should not + * preempt at all. */ - if (nthread == 1 || nthread == 0) { + if (nthread == 0) { goto done; } else if ((next_td = sched_dequeue_td()) == NULL) { /* Empty */ |