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

Comparing jsr166/src/test/tck/AtomicLongArrayTest.java (file contents):
Revision 1.35 by jsr166, Fri Jun 17 19:00:48 2016 UTC vs.
Revision 1.36 by jsr166, Thu Sep 15 01:18:01 2016 UTC

# Line 275 | Line 275 | public class AtomicLongArrayTest extends
275  
276      class Counter extends CheckedRunnable {
277          final AtomicLongArray aa;
278 <        volatile long counts;
278 >        int decs;
279          Counter(AtomicLongArray a) { aa = a; }
280          public void realRun() {
281              for (;;) {
# Line 286 | Line 286 | public class AtomicLongArrayTest extends
286                      if (v != 0) {
287                          done = false;
288                          if (aa.compareAndSet(i, v, v - 1))
289 <                            ++counts;
289 >                            decs++;
290                      }
291                  }
292                  if (done)
# Line 306 | Line 306 | public class AtomicLongArrayTest extends
306              aa.set(i, countdown);
307          Counter c1 = new Counter(aa);
308          Counter c2 = new Counter(aa);
309 <        Thread t1 = new Thread(c1);
310 <        Thread t2 = new Thread(c2);
311 <        t1.start();
312 <        t2.start();
309 >        Thread t1 = newStartedThread(c1);
310 >        Thread t2 = newStartedThread(c2);
311          t1.join();
312          t2.join();
313 <        assertEquals(c1.counts+c2.counts, SIZE * countdown);
313 >        assertEquals(c1.decs + c2.decs, SIZE * countdown);
314      }
315  
316      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines