144 |
|
final CountDownLatch pleaseInterrupt = new CountDownLatch(1); |
145 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
146 |
|
public void realRun() throws InterruptedException { |
147 |
– |
long startTime = System.nanoTime(); |
148 |
– |
|
147 |
|
Thread.currentThread().interrupt(); |
148 |
|
try { |
149 |
|
l.await(randomTimeout(), randomTimeUnit()); |
153 |
|
|
154 |
|
pleaseInterrupt.countDown(); |
155 |
|
try { |
156 |
< |
l.await(LONG_DELAY_MS, MILLISECONDS); |
156 |
> |
l.await(LONGER_DELAY_MS, MILLISECONDS); |
157 |
|
shouldThrow(); |
158 |
|
} catch (InterruptedException success) {} |
159 |
|
assertFalse(Thread.interrupted()); |
160 |
|
|
161 |
|
assertEquals(initialCount, l.getCount()); |
164 |
– |
assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); |
162 |
|
}}); |
163 |
|
|
164 |
|
await(pleaseInterrupt); |