This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Rewrite PosixProcess


David Daney writes:
 > The bits in PosixProcess were getting stale and I thought it was time to 
 > freshen them up a some.
 > 
 > The main motivation for the patch is to make it possible for libgcj to 
 > interact with other code that forks processes and catches SIGCHLD.
 > 
 > The main change is that we iterate through each known PosixProcess and 
 > try to wait specifically for it instead of all processes whenever we 
 > receive a SIGCHLD.  This allows other code to wait for its own processes.
 > 
 > Tested on x86_64-pc-linux-gnu (FC6) with no failures in libjava.
 > 
 > OK to commit?

This all seems very sensible.

A nit -- why make this change:

 > @@ -342,7 +325,7 @@ final class PosixProcess extends Process
 >  	// There is no race with reap() in the pidToProcess map
 >  	// because this is always called from the same thread
 >  	// doing the reaping.
 > -	pm.addProcessToMap(this);
 > +	pm.liveProcesses.add(this);
 >  	state = STATE_RUNNING;
 >  	// Notify anybody waiting on state change.
 >  	this.notifyAll();

rather than changing addProcessToMap to DTRT?  Seems like you've made
the encapsulation of ProcessManager worse for no good reason.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]