kernel: Do not allow sending signals to dying threads

This was causing a kernel panic when closing the terminal by directly exiting the shell (either EOF or the exit command)
This commit is contained in:
apio 2023-09-22 22:40:24 +02:00
parent 36fad85396
commit 441e04076a
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -207,6 +207,7 @@ bool Thread::will_ignore_pending_signal()
void Thread::send_signal(int signo)
{
if (is_kernel) return;
if (state == ThreadState::Exited || state == ThreadState::Dying) return;
check(signo > 0 && signo <= NSIG);
pending_signals.set(signo - 1, true);