123 |
|
* semantics for their array elements, which is not supported for |
124 |
|
* ordinary arrays. |
125 |
|
* |
126 |
< |
* <a name="Spurious"> |
127 |
< |
* <p>The atomic classes also support method {@code weakCompareAndSet}, |
128 |
< |
* which has limited applicability. On some platforms, the weak version |
129 |
< |
* may be more efficient than {@code compareAndSet} in the normal case, |
130 |
< |
* but differs in that any given invocation of the |
131 |
< |
* {@code weakCompareAndSet} method may return {@code false} |
132 |
< |
* <em>spuriously</em> (that is, for no apparent reason)</a>. A |
126 |
> |
* <p id="weakCompareAndSet">The atomic classes also support method |
127 |
> |
* {@code weakCompareAndSet}, which has limited applicability. On some |
128 |
> |
* platforms, the weak version may be more efficient than {@code |
129 |
> |
* compareAndSet} in the normal case, but differs in that any given |
130 |
> |
* invocation of the {@code weakCompareAndSet} method may return {@code |
131 |
> |
* false} <em>spuriously</em> (that is, for no apparent reason). A |
132 |
|
* {@code false} return means only that the operation may be retried if |
133 |
|
* desired, relying on the guarantee that repeated invocation when the |
134 |
|
* variable holds {@code expectedValue} and no other thread is also |
164 |
|
* |
165 |
|
* <p>Atomic classes are not general purpose replacements for |
166 |
|
* {@code java.lang.Integer} and related classes. They do <em>not</em> |
167 |
< |
* define methods such as {@code hashCode} and |
167 |
> |
* define methods such as {@code equals}, {@code hashCode} and |
168 |
|
* {@code compareTo}. (Because atomic variables are expected to be |
169 |
|
* mutated, they are poor choices for hash table keys.) Additionally, |
170 |
|
* classes are provided only for those types that are commonly useful in |