ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/LinkedBlockingDequeTest.java
(Generate patch)

Comparing jsr166/src/test/tck/LinkedBlockingDequeTest.java (file contents):
Revision 1.85 by jsr166, Thu Sep 5 20:54:24 2019 UTC vs.
Revision 1.86 by jsr166, Thu Sep 5 21:11:13 2019 UTC

# Line 776 | Line 776 | public class LinkedBlockingDequeTest ext
776          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
777          Thread t = newStartedThread(new CheckedRunnable() {
778              public void realRun() throws InterruptedException {
779                long startTime = System.nanoTime();
779                  for (int i = 0; i < SIZE; i++)
780                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
781  
# Line 789 | Line 788 | public class LinkedBlockingDequeTest ext
788  
789                  pleaseInterrupt.countDown();
790                  try {
791 <                    q.poll(LONG_DELAY_MS, MILLISECONDS);
791 >                    q.poll(LONGER_DELAY_MS, MILLISECONDS);
792                      shouldThrow();
793                  } catch (InterruptedException success) {}
794                  assertFalse(Thread.interrupted());
796
797                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
795              }});
796  
797          await(pleaseInterrupt);
# Line 1095 | Line 1092 | public class LinkedBlockingDequeTest ext
1092          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
1093          Thread t = newStartedThread(new CheckedRunnable() {
1094              public void realRun() throws InterruptedException {
1098                long startTime = System.nanoTime();
1095                  for (int i = 0; i < SIZE; i++)
1096                      assertEquals(i, q.pollFirst(LONG_DELAY_MS, MILLISECONDS));
1097  
# Line 1108 | Line 1104 | public class LinkedBlockingDequeTest ext
1104  
1105                  pleaseInterrupt.countDown();
1106                  try {
1107 <                    q.pollFirst(LONG_DELAY_MS, MILLISECONDS);
1107 >                    q.pollFirst(LONGER_DELAY_MS, MILLISECONDS);
1108                      shouldThrow();
1109                  } catch (InterruptedException success) {}
1110                  assertFalse(Thread.interrupted());
1115
1116                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1111              }});
1112  
1113          await(pleaseInterrupt);
# Line 1380 | Line 1374 | public class LinkedBlockingDequeTest ext
1374          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
1375          Thread t = newStartedThread(new CheckedRunnable() {
1376              public void realRun() throws InterruptedException {
1383                long startTime = System.nanoTime();
1377                  for (int i = 0; i < SIZE; i++)
1378                      assertEquals(SIZE - i - 1,
1379                                   q.pollLast(LONG_DELAY_MS, MILLISECONDS));
# Line 1394 | Line 1387 | public class LinkedBlockingDequeTest ext
1387  
1388                  pleaseInterrupt.countDown();
1389                  try {
1390 <                    q.pollLast(LONG_DELAY_MS, MILLISECONDS);
1390 >                    q.pollLast(LONGER_DELAY_MS, MILLISECONDS);
1391                      shouldThrow();
1392                  } catch (InterruptedException success) {}
1393                  assertFalse(Thread.interrupted());
1401
1402                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1394              }});
1395  
1396          await(pleaseInterrupt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines