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

Comparing jsr166/src/test/tck/LinkedTransferQueueTest.java (file contents):
Revision 1.82 by jsr166, Sun Aug 11 22:29:27 2019 UTC vs.
Revision 1.85 by jsr166, Fri Sep 6 22:47:02 2019 UTC

# Line 281 | Line 281 | public class LinkedTransferQueueTest ext
281          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
282          Thread t = newStartedThread(new CheckedRunnable() {
283              public void realRun() throws InterruptedException {
284                long startTime = System.nanoTime();
284                  for (int i = 0; i < SIZE; i++)
285                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
286  
# Line 294 | Line 293 | public class LinkedTransferQueueTest ext
293  
294                  pleaseInterrupt.countDown();
295                  try {
296 <                    q.poll(LONG_DELAY_MS, MILLISECONDS);
296 >                    q.poll(LONGER_DELAY_MS, MILLISECONDS);
297                      shouldThrow();
298                  } catch (InterruptedException success) {}
299                  assertFalse(Thread.interrupted());
301
302                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
300              }});
301  
302          await(pleaseInterrupt);
# Line 317 | Line 314 | public class LinkedTransferQueueTest ext
314          final BlockingQueue<Integer> q = populatedQueue(SIZE);
315          Thread t = newStartedThread(new CheckedRunnable() {
316              public void realRun() throws InterruptedException {
320                long startTime = System.nanoTime();
317                  Thread.currentThread().interrupt();
318                  for (int i = 0; i < SIZE; ++i)
319                      assertEquals(i, (int) q.poll(randomTimeout(), randomTimeUnit()));
# Line 326 | Line 322 | public class LinkedTransferQueueTest ext
322                      shouldThrow();
323                  } catch (InterruptedException success) {}
324                  assertFalse(Thread.interrupted());
329                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
325              }});
326  
327          awaitTermination(t);
# Line 955 | Line 950 | public class LinkedTransferQueueTest ext
950  
951          Thread t = newStartedThread(new CheckedRunnable() {
952              public void realRun() throws InterruptedException {
958                long startTime = System.nanoTime();
953                  Thread.currentThread().interrupt();
954                  try {
955                      q.tryTransfer(new Object(), randomTimeout(), randomTimeUnit());
# Line 965 | Line 959 | public class LinkedTransferQueueTest ext
959  
960                  pleaseInterrupt.countDown();
961                  try {
962 <                    q.tryTransfer(new Object(), LONG_DELAY_MS, MILLISECONDS);
962 >                    q.tryTransfer(new Object(), LONGER_DELAY_MS, MILLISECONDS);
963                      shouldThrow();
964                  } catch (InterruptedException success) {}
965                  assertFalse(Thread.interrupted());
972
973                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
966              }});
967  
968          await(pleaseInterrupt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines