512 |
|
final CountDownLatch pleaseInterrupt = new CountDownLatch(1); |
513 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
514 |
|
public void realRun() throws InterruptedException { |
515 |
– |
long startTime = System.nanoTime(); |
515 |
|
for (int i = 0; i < SIZE; i++) |
516 |
|
assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); |
517 |
|
|
524 |
|
|
525 |
|
pleaseInterrupt.countDown(); |
526 |
|
try { |
527 |
< |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
527 |
> |
q.poll(LONGER_DELAY_MS, MILLISECONDS); |
528 |
|
shouldThrow(); |
529 |
|
} catch (InterruptedException success) {} |
530 |
|
assertFalse(Thread.interrupted()); |
532 |
– |
|
533 |
– |
assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); |
531 |
|
}}); |
532 |
|
|
533 |
|
await(pleaseInterrupt); |