1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:28:11 +00:00

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.
This commit is contained in:
Andrew Kaster 2021-08-22 21:53:26 -06:00 committed by Andreas Kling
parent 70518e69f4
commit dea62fe93c
4 changed files with 13 additions and 13 deletions

View file

@ -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);