Author: kib
Date: Wed Feb 18 16:11:39 2009
New Revision: 188750
URL: http://svn.freebsd.org/changeset/base/188750

Log:
  Adapt linux emulation to use cv for vfork wait.
  
  Submitted by: Takahiro Kurosawa <takahiro.kurosawa gmail com>
  PR:   kern/131506

Modified:
  head/sys/amd64/linux32/linux32_machdep.c
  head/sys/i386/linux/linux_machdep.c

Modified: head/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- head/sys/amd64/linux32/linux32_machdep.c    Wed Feb 18 10:02:32 2009        
(r188749)
+++ head/sys/amd64/linux32/linux32_machdep.c    Wed Feb 18 16:11:39 2009        
(r188750)
@@ -560,7 +560,7 @@ linux_vfork(struct thread *td, struct li
        /* 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 li
                /* 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);
        }
 

Modified: head/sys/i386/linux/linux_machdep.c
==============================================================================
--- head/sys/i386/linux/linux_machdep.c Wed Feb 18 10:02:32 2009        
(r188749)
+++ head/sys/i386/linux/linux_machdep.c Wed Feb 18 16:11:39 2009        
(r188750)
@@ -376,7 +376,7 @@ linux_vfork(struct thread *td, struct li
        /* 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 li
                /* 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);
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to