Clear P_STATCHILD earlier to avoid unnecessary retrying.

This commit is contained in:
davidxu 2005-04-19 12:31:15 +00:00
parent 62e9927ccb
commit 5a22275847

View File

@ -588,6 +588,11 @@ kern_wait(struct thread *td, pid_t pid, int *status, int options,
if (options &~ (WUNTRACED|WNOHANG|WCONTINUED|WLINUXCLONE))
return (EINVAL);
loop:
if (q->p_flag & P_STATCHILD) {
PROC_LOCK(q);
q->p_flag &= ~P_STATCHILD;
PROC_UNLOCK(q);
}
nfound = 0;
sx_xlock(&proctree_lock);
LIST_FOREACH(p, &q->p_children, p_sibling) {