101 |
|
final Exchanger e = new Exchanger(); |
102 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
103 |
|
public void realRun() throws Exception { |
104 |
– |
long timeoutMillis = SHORT_DELAY_MS; |
104 |
|
long startTime = System.nanoTime(); |
105 |
|
try { |
106 |
< |
e.exchange(null, timeoutMillis, MILLISECONDS); |
106 |
> |
e.exchange(null, timeoutMillis(), MILLISECONDS); |
107 |
|
shouldThrow(); |
108 |
< |
} catch (TimeoutException success) { |
109 |
< |
assertTrue(millisElapsedSince(startTime) >= timeoutMillis); |
111 |
< |
} |
108 |
> |
} catch (TimeoutException success) {} |
109 |
> |
assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); |
110 |
|
}}); |
111 |
|
|
112 |
|
awaitTermination(t); |