diff --git a/classpath/java/lang/Thread.java b/classpath/java/lang/Thread.java index 8fc43b457f..4279e5bfbf 100644 --- a/classpath/java/lang/Thread.java +++ b/classpath/java/lang/Thread.java @@ -266,13 +266,10 @@ public class Thread implements Runnable { { long then = System.currentTimeMillis(); long remaining = milliseconds; - while (getState() != State.TERMINATED) { + while (remaining > 0 && getState() != State.TERMINATED) { wait(remaining); remaining = milliseconds - (System.currentTimeMillis() - then); - if (remaining <= 0) { - break; - } } }