summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2008-08-29 01:34:05 +0000
committerdavidxu <davidxu@FreeBSD.org>2008-08-29 01:34:05 +0000
commitb08de3bf2f23d145400d0560e99a4af360b88d47 (patch)
treed765e4cfa16e7ff896df66246fd3d5131f62f157 /sys/kern/kern_exit.c
parentdbe9aeaa2113719ca2069c9a21d8ffdd792e8d54 (diff)
downloadFreeBSD-src-b08de3bf2f23d145400d0560e99a4af360b88d47.zip
FreeBSD-src-b08de3bf2f23d145400d0560e99a4af360b88d47.tar.gz
Don't remove queued SIGCHLD if options contain WNOWAIT, so other
threads still can be notified by the signal.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index b536d99..e956cdf 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -737,12 +737,6 @@ loop:
td->td_retval[0] = p->p_pid;
if (status)
*status = p->p_xstat; /* convert to int */
- PROC_LOCK(q);
- sigqueue_take(p->p_ksi);
- PROC_UNLOCK(q);
-
- PROC_UNLOCK(p);
-
if (options & WNOWAIT) {
/*
@@ -750,10 +744,16 @@ loop:
* Caller does not wish to release the proc
* struct just yet.
*/
+ PROC_UNLOCK(p);
sx_xunlock(&proctree_lock);
return (0);
}
+ PROC_LOCK(q);
+ sigqueue_take(p->p_ksi);
+ PROC_UNLOCK(q);
+ PROC_UNLOCK(p);
+
/*
* If we got the child via a ptrace 'attach',
* we need to give it back to the old parent.
OpenPOWER on IntegriCloud