ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r429887 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
Date Tue, 08 Aug 2006 23:43:07 GMT
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


Mime
View raw message