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.16 by jsr166, Mon Oct 11 05:35:19 2010 UTC vs.
Revision 1.17 by jsr166, Mon Oct 11 07:43:53 2010 UTC

# Line 330 | Line 330 | public class PhaserTest extends JSR166Te
330      public void testAwaitAdvance3() throws InterruptedException {
331          final Phaser phaser = new Phaser();
332          phaser.register();
333 +        final CountDownLatch threadStarted = new CountDownLatch(1);
334  
335          Thread t = newStartedThread(new CheckedRunnable() {
336              public void realRun() throws InterruptedException {
337                  phaser.register();
338 <                sleepTillInterrupted(LONG_DELAY_MS);
338 >                threadStarted.countDown();
339                  phaser.awaitAdvance(phaser.arrive());
340 +                assertTrue(Thread.currentThread().isInterrupted());
341              }});
342 <        Thread.sleep(SMALL_DELAY_MS);
342 >        assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS));
343          t.interrupt();
342        Thread.sleep(SMALL_DELAY_MS);
344          phaser.arrive();
345 <        assertFalse(t.isInterrupted());
345 <        t.join();
345 >        awaitTermination(t, SMALL_DELAY_MS);
346      }
347  
348      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines