From 0cac84d6bd45ef3dd43ff049bd9984787a64c824 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 26 May 2019 02:20:16 +0200 Subject: [PATCH] Kernel: Sending a signal to yourself should block until dispatch. By moving the sending (and receiving) thread into the BlockedSignal state, we ensure that the thread doesn't continue executing until the signal has been dispatched. --- Kernel/Process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 6764b6e611..befb1b8ffc 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1232,7 +1232,7 @@ int Process::sys$kill(pid_t pid, int signal) } if (pid == m_pid) { current->send_signal(signal, this); - Scheduler::yield(); + current->block(Thread::State::BlockedSignal); return 0; } InterruptDisabler disabler;