[Patch] Rewrite PosixProcess
Andrew Haley
aph-gcc@littlepinkcloud.COM
Tue May 8 11:09:00 GMT 2007
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.
More information about the Java-patches
mailing list