Adapt linux emulation to use cv for vfork wait.

Submitted by:	Takahiro Kurosawa <takahiro.kurosawa gmail com>
PR:	kern/131506
This commit is contained in:
Konstantin Belousov 2009-02-18 16:11:39 +00:00
parent 99f41b91c3
commit 99b7f1a10b
2 changed files with 4 additions and 4 deletions

View File

@ -560,7 +560,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args *args)
/* wait for the children to exit, ie. emulate vfork */
PROC_LOCK(p2);
while (p2->p_flag & P_PPWAIT)
msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
cv_wait(&p2->p_pwait, &p2->p_mtx);
PROC_UNLOCK(p2);
return (0);
@ -749,7 +749,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
/* wait for the children to exit, ie. emulate vfork */
PROC_LOCK(p2);
while (p2->p_flag & P_PPWAIT)
msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
cv_wait(&p2->p_pwait, &p2->p_mtx);
PROC_UNLOCK(p2);
}

View File

@ -376,7 +376,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args *args)
/* wait for the children to exit, ie. emulate vfork */
PROC_LOCK(p2);
while (p2->p_flag & P_PPWAIT)
msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
cv_wait(&p2->p_pwait, &p2->p_mtx);
PROC_UNLOCK(p2);
return (0);
@ -581,7 +581,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
/* wait for the children to exit, ie. emulate vfork */
PROC_LOCK(p2);
while (p2->p_flag & P_PPWAIT)
msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
cv_wait(&p2->p_pwait, &p2->p_mtx);
PROC_UNLOCK(p2);
}