You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Elizabeth Cooper <ec...@ergotech.com> on 2005/09/13 23:34:37 UTC

thread death problem

There seem to many places in the code where there is a clause:

try {
   [...]
} catch (Throwable t) {
   [...]
}

This will cause many problems if t is a thread death.  From the JavaDocs 
for ThreadDeath:

"If ThreadDeath is caught by a method, it is important that it be rethrown 
so that the thread actually dies."

The way around this is to specifically catch "ThreadDeath" and rethrow it.

try {
   [...]
} catch (ThreadDeath td ) {
   throw td;
} catch ( Throwable t ) {
   [...]
}



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org