ladybird/Kernel/Tasks/SyncTask.cpp
Hendiadyoin1 62f9377656 Kernel: Move special sections into Sections.h
This also removes a lot of CPU.h includes infavor for Sections.h
2021-06-24 00:38:23 +02:00

28 lines
633 B
C++

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/Process.h>
#include <Kernel/Sections.h>
#include <Kernel/Tasks/SyncTask.h>
#include <Kernel/Time/TimeManagement.h>
namespace Kernel {
UNMAP_AFTER_INIT void SyncTask::spawn()
{
RefPtr<Thread> syncd_thread;
Process::create_kernel_process(syncd_thread, "SyncTask", [] {
dbgln("SyncTask is running");
for (;;) {
VFS::the().sync();
(void)Thread::current()->sleep(Time::from_seconds(1));
}
});
}
}