This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [Patch] Rewrite PosixProcess
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: David Daney <ddaney at avtrex dot com>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Tue, 8 May 2007 11:21:01 +0100
- Subject: Re: [Patch] Rewrite PosixProcess
- References: <463EC8B9.6000107@avtrex.com>
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.