Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2007 17:16:30 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 113124 for review
Message-ID:  <200701181716.l0IHGUkh061588@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113124

Change 113124 by rdivacky@rdivacky_witten on 2007/01/18 17:16:14

	Set the P_PPWAIT flag when the proc is locked.
	
	Suggested by: jhb

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#24 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#17 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#24 (text+ko) ====

@@ -533,7 +533,9 @@
 	if (error)
 		return (error);
 
+	PROC_LOCK(p2);
 	p2->p_flag |= P_PPWAIT;
+	PROC_UNLOCK(p2);
 
 	td2 = FIRST_THREAD_IN_PROC(p2);
 	
@@ -709,8 +711,11 @@
 		printf(LMSG("clone: successful rfork to %ld, stack %p sig = %d"),
 		    (long)p2->p_pid, args->stack, exit_signal);
 #endif
-	if (args->flags & CLONE_VFORK)
+	if (args->flags & CLONE_VFORK) {
+	   	PROC_LOCK(p2);
 	   	p2->p_flag |= P_PPWAIT;
+	   	PROC_UNLOCK(p2);
+	}
 
 	/*
 	 * Make this runnable after we are finished with it.

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#17 (text+ko) ====

@@ -356,7 +356,9 @@
 	if (error)
 		return (error);
 
+	PROC_LOCK(p2);
 	p2->p_flag |= P_PPWAIT;
+	PROC_UNLOCK(p2);
 
 	td2 = FIRST_THREAD_IN_PROC(p2);
 	
@@ -546,8 +548,11 @@
 		printf(LMSG("clone: successful rfork to %ld, stack %p sig = %d"),
 		    (long)p2->p_pid, args->stack, exit_signal);
 #endif
-	if (args->flags & CLONE_VFORK)
+	if (args->flags & CLONE_VFORK) {
+	   	PROC_LOCK(p2);
 		p2->p_flag |= P_PPWAIT;
+	   	PROC_UNLOCK(p2);
+	}
 
 	/*
 	 * Make this runnable after we are finished with it.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701181716.l0IHGUkh061588>