--- jsr166/src/test/tck/LinkedBlockingDequeTest.java 2017/05/14 00:48:20 1.76 +++ jsr166/src/test/tck/LinkedBlockingDequeTest.java 2017/05/14 01:30:34 1.78 @@ -663,6 +663,7 @@ public class LinkedBlockingDequeTest ext q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) {} + assertFalse(Thread.interrupted()); }}); await(pleaseInterrupt); @@ -760,9 +761,15 @@ public class LinkedBlockingDequeTest ext Thread t = newStartedThread(new CheckedRunnable() { public void realRun() throws InterruptedException { long startTime = System.nanoTime(); - for (int i = 0; i < SIZE; ++i) { + for (int i = 0; i < SIZE; i++) assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); - } + + Thread.currentThread().interrupt(); + try { + q.poll(LONG_DELAY_MS, MILLISECONDS); + shouldThrow(); + } catch (InterruptedException success) {} + assertFalse(Thread.interrupted()); pleaseInterrupt.countDown(); try { @@ -893,6 +900,7 @@ public class LinkedBlockingDequeTest ext q.offerFirst(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) {} + assertFalse(Thread.interrupted()); }}); await(pleaseInterrupt); @@ -1061,9 +1069,8 @@ public class LinkedBlockingDequeTest ext Thread t = newStartedThread(new CheckedRunnable() { public void realRun() throws InterruptedException { long startTime = System.nanoTime(); - for (int i = 0; i < SIZE; ++i) { + for (int i = 0; i < SIZE; i++) assertEquals(i, q.pollFirst(LONG_DELAY_MS, MILLISECONDS)); - } Thread.currentThread().interrupt(); try { @@ -1116,6 +1123,7 @@ public class LinkedBlockingDequeTest ext q.pollFirst(LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) {} + assertFalse(Thread.interrupted()); assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); }}); @@ -1328,10 +1336,9 @@ public class LinkedBlockingDequeTest ext Thread t = newStartedThread(new CheckedRunnable() { public void realRun() throws InterruptedException { long startTime = System.nanoTime(); - for (int i = 0; i < SIZE; ++i) { + for (int i = 0; i < SIZE; i++) assertEquals(SIZE - i - 1, q.pollLast(LONG_DELAY_MS, MILLISECONDS)); - } Thread.currentThread().interrupt(); try {