mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +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:
@@ -353,10 +353,11 @@ void Plan9FS::ensure_thread()
|
||||
auto process_name = KString::try_create("Plan9FS"sv);
|
||||
if (process_name.is_error())
|
||||
TODO();
|
||||
(void)Process::create_kernel_process(m_thread, process_name.release_value(), [&]() {
|
||||
auto [_, thread] = Process::create_kernel_process(process_name.release_value(), [&]() {
|
||||
thread_main();
|
||||
m_thread_running.store(false, AK::MemoryOrder::memory_order_release);
|
||||
});
|
||||
}).release_value_but_fixme_should_propagate_errors();
|
||||
m_thread = move(thread);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user