Browse Source

Watchdog may have yield negative wait time.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@578575 13f79535-47bb-0310-9956-ffa450edef68
remotes/1776816827838153613/tmp_25f451bd36ab3145e487fcb2cd5c62c571e5b602
Jacobus Martinus Kruithof 18 years ago
parent
commit
97a4611dc8
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/main/org/apache/tools/ant/util/Watchdog.java

+ 4
- 3
src/main/org/apache/tools/ant/util/Watchdog.java View File

@@ -109,12 +109,13 @@ public class Watchdog implements Runnable {
* has been interrupted, the watch dog listeners are informed.
*/
public synchronized void run() {
final long until = System.currentTimeMillis() + timeout;
long now = until - 1;
long now = System.currentTimeMillis();
final long until = now + timeout;
try {
while (!stopped && until > now) {
now = System.currentTimeMillis();
wait(until - now);
now = System.currentTimeMillis();
}
} catch (InterruptedException e) {
// Ignore exception


Loading…
Cancel
Save