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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to