diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-08 15:13:49 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-08 17:19:46 +0200 |
commit | a066dd1fac2bfea0439c9b4646a3efd6a4306b99 (patch) | |
tree | b810aabd926a02ed4857e04474fbd3e10a13b812 /Kernel/init.cpp | |
parent | befe4c6709815849c396d137cf97fac628812e8c (diff) | |
download | serenity-a066dd1fac2bfea0439c9b4646a3efd6a4306b99.zip |
Kernel: Move sync and finalization tasks into their own files
Instead of clogging up the initialization sequence, put these tasks
in their own files.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r-- | Kernel/init.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp index cc49a0465f..cd2832e985 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -66,6 +66,8 @@ #include <Kernel/RTC.h> #include <Kernel/Random.h> #include <Kernel/Scheduler.h> +#include <Kernel/Tasks/FinalizerTask.h> +#include <Kernel/Tasks/SyncTask.h> #include <Kernel/TTY/PTYMultiplexer.h> #include <Kernel/TTY/VirtualConsole.h> #include <Kernel/Time/TimeManagement.h> @@ -164,27 +166,8 @@ extern "C" [[noreturn]] void init() void init_stage2() { - Thread* syncd_thread = nullptr; - Process::create_kernel_process(syncd_thread, "syncd", [] { - for (;;) { - VFS::the().sync(); - Thread::current->sleep(1 * TimeManagement::the().ticks_per_second()); - } - }); - - Process::create_kernel_process(g_finalizer, "Finalizer", [] { - Thread::current->set_priority(THREAD_PRIORITY_LOW); - for (;;) { - { - InterruptDisabler disabler; - if (!g_finalizer_has_work) - Thread::current->wait_on(*g_finalizer_wait_queue); - ASSERT(g_finalizer_has_work); - g_finalizer_has_work = false; - } - Thread::finalize_dying_threads(); - } - }); + SyncTask::spawn(); + FinalizerTask::spawn(); // Sample test to see if the ACPI parser is working... klog() << "ACPI: HPET table @ " << ACPI::Parser::the().find_table("HPET"); |