fix logic in Thread.join(long) (second try)

This commit is contained in:
Joel Dice 2009-06-04 18:08:51 -06:00
parent a064c744f4
commit 16537a32bc

View File

@ -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;
}
}
}