From 16537a32bcd2383b264bd4c58e94f8040bf02e72 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 4 Jun 2009 18:08:51 -0600 Subject: [PATCH] fix logic in Thread.join(long) (second try) --- classpath/java/lang/Thread.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; - } } }