ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r578575 - /ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java
Date Sun, 23 Sep 2007 14:55:50 GMT
Author: jkf
Date: Sun Sep 23 07:55:49 2007
New Revision: 578575

URL: http://svn.apache.org/viewvc?rev=578575&view=rev
Log:
Watchdog may have yield negative wait time.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java?rev=578575&r1=578574&r2=578575&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java Sun Sep 23 07:55:49 2007
@@ -109,12 +109,13 @@
      * 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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message