Kernel: Don't acquire Mutex for hostname() before scheduling is enabled

There's no reason to acquire the mutex for this resource before APs are
booted, before scheduling is enabled, and before interrupts are enabled.
This commit is contained in:
Andrew Kaster 2021-08-22 22:03:16 -06:00 committed by Andreas Kling
parent 54161bf5b4
commit 4f2520674c
Notes: sideshowbarker 2024-07-18 05:08:37 +09:00

View File

@ -76,9 +76,9 @@ UNMAP_AFTER_INIT void Process::initialize()
next_pid.store(0, AK::MemoryOrder::memory_order_release);
hostname().with_exclusive([&](auto& name) {
name = "courage";
});
// Note: This is called before scheduling is initialized, and before APs are booted.
// So we can "safely" bypass the lock here.
reinterpret_cast<String&>(hostname()) = "courage";
create_signal_trampoline();
}