summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-12-01 23:43:15 +0000
committerjhb <jhb@FreeBSD.org>2000-12-01 23:43:15 +0000
commit6a64e36210e572b4242fa2a9b9db3599d7e8e30d (patch)
tree83d9f554216ca224412a0ff349d4f730444eb542 /sys/kern/kern_sig.c
parent537bde557a87f952713ab48b67eb60e8ab7cd9a7 (diff)
downloadFreeBSD-src-6a64e36210e572b4242fa2a9b9db3599d7e8e30d.zip
FreeBSD-src-6a64e36210e572b4242fa2a9b9db3599d7e8e30d.tar.gz
Protect p_stat with sched_lock.
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 434420b..a6d9f75 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1108,8 +1108,11 @@ psignal(p, sig)
* Defer further processing for signals which are held,
* except that stopped processes must be continued by SIGCONT.
*/
- if (action == SIG_HOLD && (!(prop & SA_CONT) || p->p_stat != SSTOP))
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (action == SIG_HOLD && (!(prop & SA_CONT) || p->p_stat != SSTOP)) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
s = splhigh();
switch (p->p_stat) {
@@ -1242,6 +1245,7 @@ runfast:
run:
setrunnable(p);
out:
+ mtx_exit(&sched_lock, MTX_SPIN);
splx(s);
}
@@ -1417,9 +1421,11 @@ stop(p)
register struct proc *p;
{
+ mtx_enter(&sched_lock, MTX_SPIN);
p->p_stat = SSTOP;
p->p_flag &= ~P_WAITED;
wakeup((caddr_t)p->p_pptr);
+ mtx_exit(&sched_lock, MTX_SPIN);
}
/*
OpenPOWER on IntegriCloud