This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: java.lang.Process.waitFor()
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: Andrew Haley <aph at redhat dot com>, Erik Poupaert <erik dot poupaert at freestyler-toolkit dot org>
- Cc: java at gcc dot gnu dot org
- Date: Sun, 28 Sep 2003 07:43:37 -0500
- Subject: Re: java.lang.Process.waitFor()
- Reply-to: gnustuff at thisiscool dot com
Hi Erik,
>I thought in direction too, but I don't know if I can apply it. I'm starting three
>threads. One feeds input to stdin; the two others capture output from stdout and
>stderr. I shouldn't interfere or block anything until the child process has exited;
>the threads should run inimpeded until then. Would you know how to introduce an
>object here?
You don't need an object. See the JavaDoc for Thread.join().
You seem to be going down the path suggested in this nice article (cf. StreamGobbler):
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html
I prettied this up once, but can't find the code anymore. I think I might have also
added a Thread.join(), but can't remember.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/