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

Comparing jsr166/src/test/tck/PhaserTest.java (file contents):
Revision 1.48 by jsr166, Sun Aug 11 22:29:27 2019 UTC vs.
Revision 1.49 by jsr166, Thu Sep 5 21:44:15 2019 UTC

# Line 476 | Line 476 | public class PhaserTest extends JSR166Te
476  
477          Thread t2 = newStartedThread(new CheckedRunnable() {
478              public void realRun() throws TimeoutException {
479                long startTime = System.nanoTime();
480
479                  Thread.currentThread().interrupt();
480                  try {
481                      phaser.awaitAdvanceInterruptibly(0, randomTimeout(), randomTimeUnit());
# Line 487 | Line 485 | public class PhaserTest extends JSR166Te
485  
486                  pleaseInterrupt.countDown();
487                  try {
488 <                    phaser.awaitAdvanceInterruptibly(0, LONG_DELAY_MS, MILLISECONDS);
488 >                    phaser.awaitAdvanceInterruptibly(0, LONGER_DELAY_MS, MILLISECONDS);
489                      shouldThrow();
490                  } catch (InterruptedException success) {}
491                  assertFalse(Thread.interrupted());
494
495                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
492              }});
493  
494          await(pleaseInterrupt);
495          assertState(phaser, 0, 1, 1);
496 <        assertThreadBlocks(t1, Thread.State.WAITING);
497 <        assertThreadBlocks(t2, Thread.State.TIMED_WAITING);
496 >        if (randomBoolean()) assertThreadBlocks(t1, Thread.State.WAITING);
497 >        if (randomBoolean()) assertThreadBlocks(t2, Thread.State.TIMED_WAITING);
498          t1.interrupt();
499          t2.interrupt();
500          awaitTermination(t1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines