summaryrefslogtreecommitdiff
path: root/vm/reference/java
diff options
context:
space:
mode:
authorChristian Thalinger <twisti@complang.tuwien.ac.at>2005-11-01 18:30:08 +0000
committerChristian Thalinger <twisti@complang.tuwien.ac.at>2005-11-01 18:30:08 +0000
commitc1214a168917fda346bf505d55d0192798deebbc (patch)
treee9d19dd85cbf83067f912b4ea07d4663ebb4721c /vm/reference/java
parent824eeae3f416aa2b2631e45bb2e6abfdaea494ac (diff)
downloadclasspath-c1214a168917fda346bf505d55d0192798deebbc.tar.gz
2005-11-01 Christian Thalinger <twisti@complang.tuwien.ac.at>
* vm/reference/java/lang/VMThread.java (sleep): Don't round ms and pass ns to Object.wait, fixes mauve test.
Diffstat (limited to 'vm/reference/java')
-rw-r--r--vm/reference/java/lang/VMThread.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/vm/reference/java/lang/VMThread.java b/vm/reference/java/lang/VMThread.java
index 6b9102b70..aa0b8347a 100644
--- a/vm/reference/java/lang/VMThread.java
+++ b/vm/reference/java/lang/VMThread.java
@@ -376,15 +376,11 @@ final class VMThread
*/
static void sleep(long ms, int ns) throws InterruptedException
{
-
- // Round up
- ms += (ns != 0) ? 1 : 0;
-
// Note: JDK treats a zero length sleep is like Thread.yield(),
// without checking the interrupted status of the thread.
// It's unclear if this is a bug in the implementation or the spec.
// See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6213203
- if (ms == 0)
+ if (ms == 0 && ns == 0)
{
if (Thread.interrupted())
throw new InterruptedException();
@@ -404,11 +400,12 @@ final class VMThread
{
while (true)
{
- vt.wait(ms);
+ vt.wait(ms, ns);
now = System.currentTimeMillis();
if (now >= end)
break;
ms = end - now;
+ ns = 0;
}
}
}