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.8 by jsr166, Sat Nov 21 20:58:45 2009 UTC vs.
Revision 1.9 by jsr166, Thu Nov 26 15:42:15 2009 UTC

# Line 194 | Line 194 | public class PhaserTest extends JSR166Te
194          for (int i = 0; i < 10; i++)
195              phaser.register();
196              threads.add(newStartedThread(new CheckedRunnable() {
197 <                void realRun() throws InterruptedException {
197 >                public void realRun() throws InterruptedException {
198                      Thread.sleep(SMALL_DELAY_MS);
199                      phaser.arriveAndDeregister();
200                  }}));
# Line 295 | Line 295 | public class PhaserTest extends JSR166Te
295      public void testArriveAndDeregister6() throws InterruptedException {
296          final Phaser phaser = new Phaser(2);
297          Thread t = newStartedThread(new CheckedRunnable() {
298 <            void realRun() {
298 >            public void realRun() {
299                  sleepTillInterrupted(SHORT_DELAY_MS);
300                  phaser.arrive();
301              }});
# Line 330 | Line 330 | public class PhaserTest extends JSR166Te
330          phaser.register();
331  
332          Thread t = newStartedThread(new CheckedRunnable() {
333 <            void realRun() throws InterruptedException {
333 >            public void realRun() throws InterruptedException {
334                  phaser.register();
335                  sleepTillInterrupted(LONG_DELAY_MS);
336                  phaser.awaitAdvance(phaser.arrive());
# Line 353 | Line 353 | public class PhaserTest extends JSR166Te
353          List<Thread> threads = new ArrayList<Thread>();
354          for (int i = 0; i < 4; i++) {
355              threads.add(newStartedThread(new CheckedRunnable() {
356 <                void realRun() {
356 >                public void realRun() {
357                      int phase = phaser.arrive();
358                      phaseCount.incrementAndGet();
359                      sleepTillInterrupted(SMALL_DELAY_MS);
# Line 376 | Line 376 | public class PhaserTest extends JSR166Te
376          List<Thread> threads = new ArrayList<Thread>();
377          for (int i = 0; i < 8; i++) {
378              threads.add(newStartedThread(new CheckedRunnable() {
379 <                void realRun() {
379 >                public void realRun() {
380                      sleepTillInterrupted(SHORT_DELAY_MS);
381                      phaser.arrive();
382                  }}));
# Line 399 | Line 399 | public class PhaserTest extends JSR166Te
399           * waits for the second thread's party to arrive
400           */
401          Thread t1 = newStartedThread(new CheckedRunnable() {
402 <            void realRun() {
402 >            public void realRun() {
403                  sleepTillInterrupted(SMALL_DELAY_MS);
404                  int phase = phaser.awaitAdvance(phaser.arrive());
405                  /*
# Line 414 | Line 414 | public class PhaserTest extends JSR166Te
414           * should exit peacefully as this one
415           */
416          Thread t2 = newStartedThread(new CheckedRunnable() {
417 <            void realRun() {
417 >            public void realRun() {
418                  sleepTillInterrupted(MEDIUM_DELAY_MS);
419                  int p1 = phaser.arrive();
420                  int phase = phaser.awaitAdvance(p1);
# Line 446 | Line 446 | public class PhaserTest extends JSR166Te
446      public void testArriveAndAwaitAdvance2() throws InterruptedException {
447          final Phaser phaser = new Phaser(2);
448          Thread th = newStartedThread(new CheckedRunnable() {
449 <            void realRun() {
449 >            public void realRun() {
450                  phaser.arriveAndAwaitAdvance();
451              }});
452  
# Line 469 | Line 469 | public class PhaserTest extends JSR166Te
469          final List<Thread> threads = new ArrayList<Thread>();
470          for (int i = 0; i < 6; i++) {
471              threads.add(newStartedThread(new CheckedRunnable() {
472 <                void realRun() throws InterruptedException {
472 >                public void realRun() throws InterruptedException {
473                      phaser.register();
474                      sleepTillInterrupted(SHORT_DELAY_MS);
475                      arrivingCount.getAndIncrement();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines