mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 02:08:53 +00:00
Kernel: Simplify Process factory functions
- Instead of taking the first new thread as an out-parameter, we now bundle the process and its first thread in a struct and use that as the return value. - Make all Process factory functions return ErrorOr. Use this to convert some places to more TRY(). - Drop the "try_" prefix on Process factory functions.
This commit is contained in:
parent
65438d8a85
commit
a098266ff5
Notes:
sideshowbarker
2024-07-17 05:05:51 +09:00
Author: https://github.com/awesomekling
Commit: a098266ff5
Pull-request: https://github.com/SerenityOS/serenity/pull/18163
Reviewed-by: https://github.com/Hendiadyoin1
12 changed files with 319 additions and 78 deletions
|
@ -14,14 +14,13 @@ namespace Kernel {
|
|||
|
||||
UNMAP_AFTER_INIT void SyncTask::spawn()
|
||||
{
|
||||
LockRefPtr<Thread> syncd_thread;
|
||||
(void)Process::create_kernel_process(syncd_thread, KString::must_create("VFS Sync Task"sv), [] {
|
||||
MUST(Process::create_kernel_process(KString::must_create("VFS Sync Task"sv), [] {
|
||||
dbgln("VFS SyncTask is running");
|
||||
for (;;) {
|
||||
VirtualFileSystem::sync();
|
||||
(void)Thread::current()->sleep(Time::from_seconds(1));
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue