From 9452a25d2d8a61849660abb8d34cba673cab0d14 Mon Sep 17 00:00:00 2001 From: davidxu Date: Tue, 19 Apr 2005 12:31:15 +0000 Subject: [PATCH] Clear P_STATCHILD earlier to avoid unnecessary retrying. --- sys/kern/kern_exit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 67ef152dc08e..d7ff96943d5a 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -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) {