You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by jk...@apache.org on 2007/09/23 16:55:50 UTC

svn commit: r578575 - /ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java

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