diff options
author | davidxu <davidxu@FreeBSD.org> | 2008-08-29 01:34:05 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2008-08-29 01:34:05 +0000 |
commit | b08de3bf2f23d145400d0560e99a4af360b88d47 (patch) | |
tree | d765e4cfa16e7ff896df66246fd3d5131f62f157 /sys/kern | |
parent | dbe9aeaa2113719ca2069c9a21d8ffdd792e8d54 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/kern/kern_exit.c | 12 |
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. |