1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

Kernel: Finalizer should not go back to sleep if there's more to do

Before putting itself back on the wait queue, the finalizer task will
now check if there's more work to do, and if so, do it first. :^)

This patch also puts a bunch of process/thread debug logging behind
PROCESS_DEBUG and THREAD_DEBUG since it was unbearable to debug this
stuff with all the spam.
This commit is contained in:
Andreas Kling 2020-02-01 10:27:25 +01:00
parent 8d51352b96
commit 934b1d8a9b
5 changed files with 36 additions and 4 deletions

View file

@ -68,6 +68,7 @@ Thread* current;
Thread* g_finalizer;
Thread* g_colonel;
WaitQueue* g_finalizer_wait_queue;
bool g_finalizer_has_work;
static Process* s_colonel_process;
u64 g_uptime;
@ -578,6 +579,7 @@ void Scheduler::initialize()
{
g_scheduler_data = new SchedulerData;
g_finalizer_wait_queue = new WaitQueue;
g_finalizer_has_work = false;
s_redirection.selector = gdt_alloc_entry();
initialize_redirection();
s_colonel_process = Process::create_kernel_process(g_colonel, "colonel", nullptr);