[cvs] / jsr166 / src / test / tck / AtomicIntegerArrayTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AtomicIntegerArrayTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27, Thu May 30 03:28:55 2013 UTC revision 1.28, Tue Sep 24 18:50:44 2013 UTC
# Line 272  Line 272 
272          }          }
273      }      }
274    
     static final int COUNTDOWN = 100000;  
   
275      class Counter extends CheckedRunnable {      class Counter extends CheckedRunnable {
276          final AtomicIntegerArray aa;          final AtomicIntegerArray aa;
277          volatile int counts;          volatile int counts;
# Line 302  Line 300 
300       */       */
301      public void testCountingInMultipleThreads() throws InterruptedException {      public void testCountingInMultipleThreads() throws InterruptedException {
302          final AtomicIntegerArray aa = new AtomicIntegerArray(SIZE);          final AtomicIntegerArray aa = new AtomicIntegerArray(SIZE);
303            int countdown = 10000;
304          for (int i = 0; i < SIZE; i++)          for (int i = 0; i < SIZE; i++)
305              aa.set(i, COUNTDOWN);              aa.set(i, countdown);
306          Counter c1 = new Counter(aa);          Counter c1 = new Counter(aa);
307          Counter c2 = new Counter(aa);          Counter c2 = new Counter(aa);
308          Thread t1 = new Thread(c1);          Thread t1 = new Thread(c1);
# Line 312  Line 311 
311          t2.start();          t2.start();
312          t1.join();          t1.join();
313          t2.join();          t2.join();
314          assertEquals(c1.counts+c2.counts, SIZE * COUNTDOWN);          assertEquals(c1.counts+c2.counts, SIZE * countdown);
315      }      }
316    
317      /**      /**

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8