Browse Source

Avoid a useless exception being (sometimes) thrown if a <java fork="true"> task is halted with Thread.stop().

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@429887 13f79535-47bb-0310-9956-ffa450edef68
master
Jesse N. Glick 19 years ago
parent
commit
9b29322cc4
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java

+ 4
- 1
src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java View File

@@ -142,7 +142,10 @@ class ProcessDestroyer implements Runnable {
// eligible for garbage collection
// Cf.: http://developer.java.sun.com/developer/bugParade/bugs/4533087.html
destroyProcessThread.setShouldDestroy(false);
destroyProcessThread.start();
if (!destroyProcessThread.getThreadGroup().isDestroyed()) {
// start() would throw IllegalThreadStateException from ThreadGroup.add if it were destroyed
destroyProcessThread.start();
}
// this should return quickly, since it basically is a NO-OP.
try {
destroyProcessThread.join(20000);


Loading…
Cancel
Save