761 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
762 |
|
public void realRun() throws InterruptedException { |
763 |
|
long startTime = System.nanoTime(); |
764 |
< |
for (int i = 0; i < SIZE; ++i) { |
764 |
> |
for (int i = 0; i < SIZE; i++) |
765 |
|
assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); |
766 |
< |
} |
766 |
> |
|
767 |
> |
Thread.currentThread().interrupt(); |
768 |
> |
try { |
769 |
> |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
770 |
> |
shouldThrow(); |
771 |
> |
} catch (InterruptedException success) {} |
772 |
> |
assertFalse(Thread.interrupted()); |
773 |
|
|
774 |
|
pleaseInterrupt.countDown(); |
775 |
|
try { |
1069 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
1070 |
|
public void realRun() throws InterruptedException { |
1071 |
|
long startTime = System.nanoTime(); |
1072 |
< |
for (int i = 0; i < SIZE; ++i) { |
1072 |
> |
for (int i = 0; i < SIZE; i++) |
1073 |
|
assertEquals(i, q.pollFirst(LONG_DELAY_MS, MILLISECONDS)); |
1068 |
– |
} |
1074 |
|
|
1075 |
|
Thread.currentThread().interrupt(); |
1076 |
|
try { |
1336 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
1337 |
|
public void realRun() throws InterruptedException { |
1338 |
|
long startTime = System.nanoTime(); |
1339 |
< |
for (int i = 0; i < SIZE; ++i) { |
1339 |
> |
for (int i = 0; i < SIZE; i++) |
1340 |
|
assertEquals(SIZE - i - 1, |
1341 |
|
q.pollLast(LONG_DELAY_MS, MILLISECONDS)); |
1337 |
– |
} |
1342 |
|
|
1343 |
|
Thread.currentThread().interrupt(); |
1344 |
|
try { |