369 |
|
*/ |
370 |
|
public void testTimedPollWithOffer() throws InterruptedException { |
371 |
|
final LinkedTransferQueue q = new LinkedTransferQueue(); |
372 |
< |
Thread t = newStartedThread(new CheckedInterruptedRunnable() { |
372 |
> |
Thread t = new Thread(new CheckedRunnable() { |
373 |
|
void realRun() throws InterruptedException { |
374 |
< |
threadAssertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
375 |
< |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
376 |
< |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
374 |
> |
assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
375 |
> |
assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); |
376 |
> |
try { |
377 |
> |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
378 |
> |
shouldThrow(); |
379 |
> |
} catch (InterruptedException success) {} |
380 |
|
}}); |
381 |
+ |
|
382 |
|
Thread.sleep(SMALL_DELAY_MS); |
383 |
|
assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS)); |
384 |
|
t.interrupt(); |