354 |
|
*/ |
355 |
|
public void testInterruptedTimedPoll() throws InterruptedException { |
356 |
|
final LinkedTransferQueue<Integer> q = populatedQueue(SIZE); |
357 |
< |
Thread t = newStartedThread(new CheckedInterruptedRunnable() { |
357 |
> |
Thread t = newStartedThread(new CheckedRunnable() { |
358 |
|
void realRun() throws InterruptedException { |
359 |
|
for (int i = 0; i < SIZE; ++i) { |
360 |
|
long t0 = System.nanoTime(); |
363 |
|
long millisElapsed = (System.nanoTime() - t0)/(1024 * 1024); |
364 |
|
assertTrue(millisElapsed < SMALL_DELAY_MS); |
365 |
|
} |
366 |
< |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
366 |
> |
try { |
367 |
> |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
368 |
> |
} catch (InterruptedException success) {} |
369 |
|
}}); |
370 |
|
Thread.sleep(SMALL_DELAY_MS); |
371 |
|
t.interrupt(); |