171 |
|
AtomicReferenceArray aa = new AtomicReferenceArray(SIZE); |
172 |
|
for (int i = 0; i < SIZE; i++) { |
173 |
|
aa.set(i, one); |
174 |
< |
while (!aa.weakCompareAndSet(i, one, two)); |
175 |
< |
while (!aa.weakCompareAndSet(i, two, m4)); |
174 |
> |
do {} while (!aa.weakCompareAndSet(i, one, two)); |
175 |
> |
do {} while (!aa.weakCompareAndSet(i, two, m4)); |
176 |
|
assertSame(m4, aa.get(i)); |
177 |
< |
while (!aa.weakCompareAndSet(i, m4, seven)); |
177 |
> |
do {} while (!aa.weakCompareAndSet(i, m4, seven)); |
178 |
|
assertSame(seven, aa.get(i)); |
179 |
|
} |
180 |
|
} |