diff --git a/src/main/org/apache/tools/ant/util/WorkerAnt.java b/src/main/org/apache/tools/ant/util/WorkerAnt.java index 919cf4641..725a72a2d 100644 --- a/src/main/org/apache/tools/ant/util/WorkerAnt.java +++ b/src/main/org/apache/tools/ant/util/WorkerAnt.java @@ -114,10 +114,9 @@ public class WorkerAnt extends Thread { */ public void waitUntilFinished(long timeout) throws InterruptedException { synchronized(notify) { - if(finished) { - return; + while (!finished) { + notify.wait(timeout); } - notify.wait(timeout); } }