diff --git a/WHATSNEW b/WHATSNEW
index 7eb1b949c..4e48b0368 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -107,6 +107,15 @@ Other changes:
used to manifest itself in unrelated errors like
Bugzilla Report 43586.
+ * A change that made more reliable on Windows (Bugzilla Report
+ 5003) strongly impacts the performance for commands that execute
+ quickly, like attrib. Basically no single execution of a command
+ could take less than a second on Windows.
+ A few timeouts have been tweaked to allow these commands to finish
+ more quickly but still they will take longer than they did with Ant
+ 1.7.1.
+ Bugzilla Report 48734.
+
Changes from Ant 1.8.0RC1 TO Ant 1.8.0
======================================
diff --git a/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java b/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
index 1187ac175..573f40679 100644
--- a/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
+++ b/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
@@ -148,7 +148,7 @@ public class PumpStreamHandler implements ExecuteStreamHandler {
finish(errorThread);
}
- private static final long JOIN_TIMEOUT = 500;
+ private static final long JOIN_TIMEOUT = 200;
/**
* Waits for a thread to finish while trying to make it finish
@@ -160,11 +160,18 @@ public class PumpStreamHandler implements ExecuteStreamHandler {
*/
protected final void finish(Thread t) {
try {
- t.join(JOIN_TIMEOUT);
StreamPumper s = null;
if (t instanceof ThreadWithPumper) {
s = ((ThreadWithPumper) t).getPumper();
}
+ if (s != null && s.isFinished()) {
+ return;
+ }
+ if (!t.isAlive()) {
+ return;
+ }
+
+ t.join(JOIN_TIMEOUT);
if (s != null && !s.isFinished()) {
s.stop();
}
diff --git a/src/tests/antunit/taskdefs/exec/exec-test.xml b/src/tests/antunit/taskdefs/exec/exec-test.xml
index c7202f9c4..84f66d3e2 100644
--- a/src/tests/antunit/taskdefs/exec/exec-test.xml
+++ b/src/tests/antunit/taskdefs/exec/exec-test.xml
@@ -628,4 +628,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+