463 |
|
final CountDownLatch pleaseInterrupt = new CountDownLatch(1); |
464 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
465 |
|
public void realRun() throws InterruptedException { |
466 |
– |
long startTime = System.nanoTime(); |
466 |
|
for (int i = 0; i < SIZE; i++) |
467 |
|
assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); |
468 |
|
|
475 |
|
|
476 |
|
pleaseInterrupt.countDown(); |
477 |
|
try { |
478 |
< |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
478 |
> |
q.poll(LONGER_DELAY_MS, MILLISECONDS); |
479 |
|
shouldThrow(); |
480 |
|
} catch (InterruptedException success) {} |
481 |
|
assertFalse(Thread.interrupted()); |
483 |
– |
|
484 |
– |
assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); |
482 |
|
}}); |
483 |
|
|
484 |
|
await(pleaseInterrupt); |