# | Line 98 | Line 98 | public class AtomicReferenceTest extends | |
---|---|---|
98 | */ | |
99 | public void testWeakCompareAndSet() { | |
100 | AtomicReference ai = new AtomicReference(one); | |
101 | < | while (!ai.weakCompareAndSet(one, two)); |
102 | < | while (!ai.weakCompareAndSet(two, m4)); |
101 | > | do {} while (!ai.weakCompareAndSet(one, two)); |
102 | > | do {} while (!ai.weakCompareAndSet(two, m4)); |
103 | assertSame(m4, ai.get()); | |
104 | < | while (!ai.weakCompareAndSet(m4, seven)); |
104 | > | do {} while (!ai.weakCompareAndSet(m4, seven)); |
105 | assertSame(seven, ai.get()); | |
106 | } | |
107 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |