--- a/jdk/test/java/util/concurrent/tck/AtomicIntegerArrayTest.java Fri Sep 23 13:21:23 2016 -0700
+++ b/jdk/test/java/util/concurrent/tck/AtomicIntegerArrayTest.java Fri Sep 23 13:24:33 2016 -0700
@@ -303,7 +303,7 @@
class Counter extends CheckedRunnable {
final AtomicIntegerArray aa;
- volatile int counts;
+ int decs;
Counter(AtomicIntegerArray a) { aa = a; }
public void realRun() {
for (;;) {
@@ -314,7 +314,7 @@
if (v != 0) {
done = false;
if (aa.compareAndSet(i, v, v - 1))
- ++counts;
+ decs++;
}
}
if (done)
@@ -334,13 +334,11 @@
aa.set(i, countdown);
Counter c1 = new Counter(aa);
Counter c2 = new Counter(aa);
- Thread t1 = new Thread(c1);
- Thread t2 = new Thread(c2);
- t1.start();
- t2.start();
+ Thread t1 = newStartedThread(c1);
+ Thread t2 = newStartedThread(c2);
t1.join();
t2.join();
- assertEquals(c1.counts+c2.counts, SIZE * countdown);
+ assertEquals(c1.decs + c2.decs, SIZE * countdown);
}
/**