summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-12-01 16:59:02 +0000
committerjhb <jhb@FreeBSD.org>2000-12-01 16:59:02 +0000
commita9bb340be284f99abd9ac317596117962b9a96eb (patch)
treeddb6db7d5f0ab0a7f4330ff7eaf04789c08466d5 /sys/kern/kern_exit.c
parent7679eff29594d117cda151a56e29490265ab98cb (diff)
downloadFreeBSD-src-a9bb340be284f99abd9ac317596117962b9a96eb.zip
FreeBSD-src-a9bb340be284f99abd9ac317596117962b9a96eb.tar.gz
Protect p_stat with sched_lock.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 1c03e7b..69f526c 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -439,7 +439,10 @@ loop:
continue;
nfound++;
+ mtx_enter(&sched_lock, MTX_SPIN);
if (p->p_stat == SZOMB) {
+ mtx_exit(&sched_lock, MTX_SPIN);
+
/* charge childs scheduling cpu usage to parent */
if (curproc->p_pid != 1) {
curproc->p_estcpu =
@@ -542,6 +545,7 @@ loop:
}
if (p->p_stat == SSTOP && (p->p_flag & P_WAITED) == 0 &&
(p->p_flag & P_TRACED || uap->options & WUNTRACED)) {
+ mtx_exit(&sched_lock, MTX_SPIN);
p->p_flag |= P_WAITED;
q->p_retval[0] = p->p_pid;
#ifdef COMPAT_43
@@ -558,6 +562,7 @@ loop:
error = 0;
return (error);
}
+ mtx_exit(&sched_lock, MTX_SPIN);
}
if (nfound == 0)
return (ECHILD);
OpenPOWER on IntegriCloud