diff options
| author | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
| commit | 8f523f3a1047919d3563daf1ef47ba87336ebe89 (patch) | |
| tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/vm/reference/java/lang/VMThread.java | |
| parent | 02e549bfaaec38f68307e7f34e46ea57ea1809af (diff) | |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
From-SVN: r107049
Diffstat (limited to 'libjava/classpath/vm/reference/java/lang/VMThread.java')
| -rw-r--r-- | libjava/classpath/vm/reference/java/lang/VMThread.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libjava/classpath/vm/reference/java/lang/VMThread.java b/libjava/classpath/vm/reference/java/lang/VMThread.java index 6b9102b7071..aa0b8347a73 100644 --- a/libjava/classpath/vm/reference/java/lang/VMThread.java +++ b/libjava/classpath/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; } } } |
