10 |
|
import java.util.concurrent.atomic.*; |
11 |
|
|
12 |
|
public class AtomicStampedReferenceTest extends JSR166TestCase { |
13 |
< |
public static void main (String[] args) { |
14 |
< |
junit.textui.TestRunner.run (suite()); |
13 |
> |
public static void main(String[] args) { |
14 |
> |
junit.textui.TestRunner.run(suite()); |
15 |
|
} |
16 |
|
public static Test suite() { |
17 |
|
return new TestSuite(AtomicStampedReferenceTest.class); |
136 |
|
int[] mark = new int[1]; |
137 |
|
AtomicStampedReference ai = new AtomicStampedReference(one, 0); |
138 |
|
assertSame(one, ai.get(mark)); |
139 |
< |
assertEquals(0, ai.getStamp ()); |
139 |
> |
assertEquals(0, ai.getStamp()); |
140 |
|
assertEquals(0, mark[0]); |
141 |
|
|
142 |
|
while (!ai.weakCompareAndSet(one, two, 0, 0)); |