From b08de3bf2f23d145400d0560e99a4af360b88d47 Mon Sep 17 00:00:00 2001 From: davidxu Date: Fri, 29 Aug 2008 01:34:05 +0000 Subject: Don't remove queued SIGCHLD if options contain WNOWAIT, so other threads still can be notified by the signal. --- sys/kern/kern_exit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/kern') 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. -- cgit v1.1