Sorry, I didn't make myself clear. I was actually thinking of using a read timeout so that the read call returns periodically and you can test interrupted(), but on reflection, you can only do that with sockets.
I'll get my coat... ;-) On 10 August 2010 20:45, Stefan Bodewig <bode...@apache.org> wrote: > On 2010-08-10, Danny Yates wrote: > > > Why does the StreamPumper poll like that? > > So it can be interrupted. > > > Surely it should just block reading the InputStream? > > It used to do just that. > > On Windows if a process spawns children (grandchildren of Ant in this > case) they inherit the streams of their parent. In cases where a > process forked by Ant spawns new processes and then finishs Ant would > wait for the grandchildren which is not desired. Instead we want Ant to > go on once the forked process is done. > > > To deal with InterruptedException, you can just do a timed read and > > test the interrupted flag before looping back to the blocking read. > > I'm not sure I follow you here. Are you talking about NIO's Selector > with "timed read"? When Ant was changed to use polling we still lived > in Java 1.3 API land and so never looked at NIO options. I'm afraid the > InputStreams provided by the Process class won't provide > SelectableChannels, though. > > Stefan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org > For additional commands, e-mail: dev-h...@ant.apache.org > >