Browse Source

Make not so strong, we don't really know whether we've managed to end

the spawned thread.  Make the thread a daemon thread.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272238 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
614713629b
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java

+ 6
- 1
src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java View File

@@ -139,6 +139,11 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
run();
} else {
thread = new Thread(this, "ExecuteJava");
// if we run into a timout, the run-away thread shall not
// make the VM run forever - if no timeout occurs, Ant's
// main thread will still be there to let the new thread
// finish
thread.setDaemon(true);
Watchdog w = new Watchdog(timeout.longValue());
w.addTimeoutObserver(this);
synchronized (this) {
@@ -148,7 +153,7 @@ public class ExecuteJava implements Runnable, TimeoutObserver {
wait();
} catch (InterruptedException e) {}
if (timedOut) {
project.log("Timeout: killed the sub-process",
project.log("Timeout: sub-process interrupted",
Project.MSG_WARN);
} else {
thread = null;


Loading…
Cancel
Save