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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]