1.1 --- a/emul/compact/src/main/java/java/util/concurrent/TimeUnit.java Fri Feb 01 16:10:10 2013 +0100
1.2 +++ b/emul/compact/src/main/java/java/util/concurrent/TimeUnit.java Fri Feb 01 16:25:57 2013 +0100
1.3 @@ -334,14 +334,14 @@
1.4 * or equal to zero, do not wait at all.
1.5 * @throws InterruptedException if interrupted while waiting
1.6 */
1.7 - public void timedJoin(Thread thread, long timeout)
1.8 - throws InterruptedException {
1.9 - if (timeout > 0) {
1.10 - long ms = toMillis(timeout);
1.11 - int ns = excessNanos(timeout, ms);
1.12 - thread.join(ms, ns);
1.13 - }
1.14 - }
1.15 +// public void timedJoin(Thread thread, long timeout)
1.16 +// throws InterruptedException {
1.17 +// if (timeout > 0) {
1.18 +// long ms = toMillis(timeout);
1.19 +// int ns = excessNanos(timeout, ms);
1.20 +// thread.join(ms, ns);
1.21 +// }
1.22 +// }
1.23
1.24 /**
1.25 * Performs a {@link Thread#sleep(long, int) Thread.sleep} using
1.26 @@ -357,7 +357,10 @@
1.27 if (timeout > 0) {
1.28 long ms = toMillis(timeout);
1.29 int ns = excessNanos(timeout, ms);
1.30 - Thread.sleep(ms, ns);
1.31 + Object o = new Object();
1.32 + synchronized (o) {
1.33 + o.wait(ms, ns);
1.34 + }
1.35 }
1.36 }
1.37