diff options
author | Andrew Kaster <akaster@serenityos.org> | 2021-08-22 22:03:16 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-28 20:53:38 +0200 |
commit | 4f2520674caa937dedc6572fdf310f5e0ae42074 (patch) | |
tree | da2174bddf0feb722170eb74611849c9e13c0ed6 /Kernel/Process.cpp | |
parent | 54161bf5b406c1fbfff34837a1a9b785c1da6e8b (diff) | |
download | serenity-4f2520674caa937dedc6572fdf310f5e0ae42074.zip |
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.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index d434b37738..04959e4203 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -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(); } |