From 8f8f442f0f903863167ce67b97f694e35eb2fcc2 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:47:13 +0300 Subject: [PATCH] Comments --- src/core/kernel/threads.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/kernel/threads.cpp b/src/core/kernel/threads.cpp index 7d3d9f14..2e39b620 100644 --- a/src/core/kernel/threads.cpp +++ b/src/core/kernel/threads.cpp @@ -340,9 +340,11 @@ void Kernel::sleepThread(s64 ns) { if (ns < 0) { Helpers::panic("Sleeping a thread for a negative amount of ns"); } else if (ns == 0) { - // TODO: This is garbage, absolutely not getting merged + // TODO: This is garbage, but it works so eh we can keep it for now Thread& t = threads[currentThreadIndex]; + // See if a thread other than this and the idle thread is waiting to run by temp marking the current function as dead and searching + // If there is another thread to run, then run it. Otherwise, go back to this thread, not to the idle thread t.status = ThreadStatus::Dead; auto nextThreadIndex = getNextThread(); t.status = ThreadStatus::Ready;