You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by jg...@apache.org on 2006/08/09 01:43:07 UTC

svn commit: r429887 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java

Author: jglick
Date: Tue Aug  8 16:43:07 2006
New Revision: 429887

URL: http://svn.apache.org/viewvc?rev=429887&view=rev
Log:
Avoid a useless exception being (sometimes) thrown if a <java fork="true"> task is halted with Thread.stop().

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java?rev=429887&r1=429886&r2=429887&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java Tue Aug  8 16:43:07 2006
@@ -142,7 +142,10 @@
             // 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);



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