17 |
|
long w; |
18 |
|
|
19 |
|
public static void main(String[] args) { |
20 |
< |
junit.textui.TestRunner.run(suite()); |
20 |
> |
main(suite(), args); |
21 |
|
} |
22 |
|
public static Test suite() { |
23 |
|
return new TestSuite(AtomicLongFieldUpdaterTest.class); |
134 |
|
AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a; |
135 |
|
a = updaterFor("x"); |
136 |
|
x = 1; |
137 |
< |
while (!a.weakCompareAndSet(this, 1, 2)); |
138 |
< |
while (!a.weakCompareAndSet(this, 2, -4)); |
137 |
> |
do {} while (!a.weakCompareAndSet(this, 1, 2)); |
138 |
> |
do {} while (!a.weakCompareAndSet(this, 2, -4)); |
139 |
|
assertEquals(-4, a.get(this)); |
140 |
< |
while (!a.weakCompareAndSet(this, -4, 7)); |
140 |
> |
do {} while (!a.weakCompareAndSet(this, -4, 7)); |
141 |
|
assertEquals(7, a.get(this)); |
142 |
|
} |
143 |
|
|