119 |
|
} |
120 |
|
|
121 |
|
/** |
122 |
< |
* compareAndSet succeeds in changing value if equal to expected else fails |
122 |
> |
* compareAndSet succeeds in changing value if same as expected else fails |
123 |
|
*/ |
124 |
|
public void testCompareAndSet() { |
125 |
|
AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a; |
135 |
|
} |
136 |
|
|
137 |
|
/** |
138 |
+ |
* compareAndSet succeeds in changing protected field value if |
139 |
+ |
* same as expected else fails |
140 |
+ |
*/ |
141 |
+ |
public void testCompareAndSetProtectedInSubclass() { |
142 |
+ |
new NonNestmates.AtomicReferenceFieldUpdaterTestSubclass() |
143 |
+ |
.checkCompareAndSetProtectedSub(); |
144 |
+ |
} |
145 |
+ |
|
146 |
+ |
/** |
147 |
|
* compareAndSet in one thread enables another waiting for value |
148 |
|
* to succeed |
149 |
|
*/ |
166 |
|
} |
167 |
|
|
168 |
|
/** |
169 |
< |
* repeated weakCompareAndSet succeeds in changing value when equal |
161 |
< |
* to expected |
169 |
> |
* repeated weakCompareAndSet succeeds in changing value when same as expected |
170 |
|
*/ |
171 |
|
public void testWeakCompareAndSet() { |
172 |
|
AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer> a; |