summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/fork.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-07-11 23:25:24 -0700
committerGunnar Beutner <gunnar@beutner.name>2021-07-12 10:20:21 +0200
commit84b4b9447d682efdab1e83b3cb0cd8a239825226 (patch)
tree4c98c44ce7025927a425cb071a688c42d9ac1826 /Kernel/Syscalls/fork.cpp
parent60a559af7ebc70f3604ce8b5649551560d87923b (diff)
downloadserenity-84b4b9447d682efdab1e83b3cb0cd8a239825226.zip
Kernel: Move new process registration out of Space spinlock scope
There appears to be no reason why the process registration needs to happen under the space spin lock. As the first thread is not started yet it should be completely uncontested, but it's still bad practice.
Diffstat (limited to 'Kernel/Syscalls/fork.cpp')
-rw-r--r--Kernel/Syscalls/fork.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/fork.cpp b/Kernel/Syscalls/fork.cpp
index 4619424fc6..b4782d1077 100644
--- a/Kernel/Syscalls/fork.cpp
+++ b/Kernel/Syscalls/fork.cpp
@@ -108,10 +108,10 @@ KResultOr<FlatPtr> Process::sys$fork(RegisterState& regs)
if (region == m_master_tls_region.unsafe_ptr())
child->m_master_tls_region = child_region;
}
-
- Process::register_new(*child);
}
+ Process::register_new(*child);
+
PerformanceManager::add_process_created_event(*child);
ScopedSpinLock lock(g_scheduler_lock);