summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/kill.cpp
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-08-22 21:53:26 -0600
committerAndreas Kling <kling@serenityos.org>2021-08-28 20:53:38 +0200
commitdea62fe93c09900b1453519d6adc768eb177b18f (patch)
tree20164a3bc7c8858f974a95c35597f1d05cec4e9b /Kernel/Syscalls/kill.cpp
parent70518e69f40869b2fb6cbf69e33cbd24ecfa6d61 (diff)
downloadserenity-dea62fe93c09900b1453519d6adc768eb177b18f.zip
Kernel: Guard the all processes list with a Spinlock rather than a Mutex
There are callers of processes().with or processes().for_each that require interrupts to be disabled. Taking a Mutexe with interrupts disabled is a recipe for deadlock, so convert this to a Spinlock.
Diffstat (limited to 'Kernel/Syscalls/kill.cpp')
-rw-r--r--Kernel/Syscalls/kill.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/kill.cpp b/Kernel/Syscalls/kill.cpp
index 4033348e94..24339516db 100644
--- a/Kernel/Syscalls/kill.cpp
+++ b/Kernel/Syscalls/kill.cpp
@@ -65,7 +65,7 @@ KResult Process::do_killall(int signal)
KResult error = KSuccess;
// Send the signal to all processes we have access to for.
- processes().for_each_shared([&](auto& process) {
+ processes().for_each([&](auto& process) {
KResult res = KSuccess;
if (process.pid() == pid())
res = do_killself(signal);