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

Kernel: Use a WaitQueue to implement finalizer wakeup

This gets rid of the special "Lurking" thread state and replaces it
with a generic WaitQueue :^)
This commit is contained in:
Andreas Kling 2019-12-01 19:17:17 +01:00
parent 5a45376180
commit 8bb98aa31b
5 changed files with 9 additions and 9 deletions

View file

@ -319,8 +319,8 @@ extern "C" [[noreturn]] void init(u32 physical_address_for_kernel_page_tables)
g_finalizer = current;
current->set_priority(ThreadPriority::Low);
for (;;) {
current->wait_on(*g_finalizer_wait_queue);
Thread::finalize_dying_threads();
(void)current->block<Thread::SemiPermanentBlocker>(Thread::SemiPermanentBlocker::Reason::Lurking);
}
});