commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sandy...@apache.org
Subject svn commit: r383450 - /jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
Date Mon, 06 Mar 2006 02:57:56 GMT
Author: sandymac
Date: Sun Mar  5 18:57:54 2006
New Revision: 383450

URL: http://svn.apache.org/viewcvs?rev=383450&view=rev
Log:
spin(long) with a Thread.sleep to idle the cpu

Modified:
    jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java

Modified: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java?rev=383450&r1=383449&r2=383450&view=diff
==============================================================================
--- jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
(original)
+++ jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
Sun Mar  5 18:57:54 2006
@@ -523,8 +523,11 @@
         }
     }
 
-    private void spin(long now) {
-        while (System.currentTimeMillis() <= now + 1000);
+    private void spin(long now) throws InterruptedException {
+        final long end = now + 1000;
+        while (System.currentTimeMillis() <= end) {
+            Thread.sleep(Math.max(1, end - System.currentTimeMillis()));
+        }
     }
 
 }



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


Mime
View raw message