aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-04-13 19:42:12 -0400
committerIan Moffett <ian@osmora.org>2024-04-13 19:42:12 -0400
commitff974bd5d1883fd5f48ff11372e9760d8d05a141 (patch)
tree882602d3ca6cdc952c5876ee65872ba7c07953c9 /sys
parent50960b5c42e47ac33556468ce263c2dc3c44abf6 (diff)
kernel: signal: Fix deadlock in signal_handle()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_signal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_signal.c b/sys/kern/kern_signal.c
index 96c02a5..7c31c86 100644
--- a/sys/kern/kern_signal.c
+++ b/sys/kern/kern_signal.c
@@ -56,12 +56,13 @@ signal_handle(struct proc *curtd)
{
int signo = curtd->signal;
- spinlock_acquire(&curtd->lock);
if (signo == 0) {
return;
}
+ spinlock_acquire(&curtd->lock);
curtd->signal = 0;
+
switch (signo) {
case SIGFPE:
signal_log("Arithmetic error\n");