diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-02-04 13:01:46 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-06 20:36:53 +0100 |
commit | fe7b08dad7a41251469840ab15ab90bc9b31caa8 (patch) | |
tree | d15a9a11f95b2fc18a34ef29465fae7f289e7dca /Kernel/FileSystem/SysFS | |
parent | b26ecca970e49dd974fb1b620ab6bec80f5f6670 (diff) | |
download | serenity-fe7b08dad7a41251469840ab15ab90bc9b31caa8.zip |
Kernel: Protect Process::m_name with a spinlock
This also lets us remove the `get_process_name` and `set_process_name`
syscalls from the big lock. :^)
Diffstat (limited to 'Kernel/FileSystem/SysFS')
-rw-r--r-- | Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp b/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp index 10500a3608..e53d1047b7 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp +++ b/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp @@ -79,7 +79,7 @@ ErrorOr<void> SysFSOverallProcesses::try_generate(KBufferBuilder& builder) TRY(process_object.add("tty"sv, "")); } TRY(process_object.add("nfds"sv, process.fds().with_shared([](auto& fds) { return fds.open_count(); }))); - TRY(process_object.add("name"sv, process.name())); + TRY(process.name().with([&](auto& process_name) { return process_object.add("name"sv, process_name->view()); })); TRY(process_object.add("executable"sv, process.executable() ? TRY(process.executable()->try_serialize_absolute_path())->view() : ""sv)); size_t amount_virtual = 0; |