281 |
|
final CountDownLatch pleaseInterrupt = new CountDownLatch(1); |
282 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
283 |
|
public void realRun() throws InterruptedException { |
284 |
– |
long startTime = System.nanoTime(); |
284 |
|
for (int i = 0; i < SIZE; i++) |
285 |
|
assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); |
286 |
|
|
293 |
|
|
294 |
|
pleaseInterrupt.countDown(); |
295 |
|
try { |
296 |
< |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
296 |
> |
q.poll(LONGER_DELAY_MS, MILLISECONDS); |
297 |
|
shouldThrow(); |
298 |
|
} catch (InterruptedException success) {} |
299 |
|
assertFalse(Thread.interrupted()); |
301 |
– |
|
302 |
– |
assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); |
300 |
|
}}); |
301 |
|
|
302 |
|
await(pleaseInterrupt); |