29 |
|
* private static AtomicReferenceFieldUpdater<Node, Node> rightUpdater = |
30 |
|
* AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "right"); |
31 |
|
* |
32 |
< |
* Node getLeft() { return left; } |
32 |
> |
* Node getLeft() { return left; } |
33 |
|
* boolean compareAndSetLeft(Node expect, Node update) { |
34 |
|
* return leftUpdater.compareAndSet(this, expect, update); |
35 |
|
* } |
58 |
|
* @param tclass the class of the objects holding the field |
59 |
|
* @param vclass the class of the field |
60 |
|
* @param fieldName the name of the field to be updated |
61 |
+ |
* @param <U> the type of instances of tclass |
62 |
+ |
* @param <W> the type of instances of vclass |
63 |
|
* @return the updater |
64 |
|
* @throws IllegalArgumentException if the field is not a volatile reference type |
65 |
|
* @throws RuntimeException with a nested reflection-based |
100 |
|
* other calls to {@code compareAndSet} and {@code set}, but not |
101 |
|
* necessarily with respect to other changes in the field. |
102 |
|
* |
103 |
< |
* <p>May <a href="package-summary.html#Spurious">fail spuriously</a> |
104 |
< |
* and does not provide ordering guarantees, so is only rarely an |
105 |
< |
* appropriate alternative to {@code compareAndSet}. |
103 |
> |
* <p><a href="package-summary.html#weakCompareAndSet">May fail |
104 |
> |
* spuriously and does not provide ordering guarantees</a>, so is |
105 |
> |
* only rarely an appropriate alternative to {@code compareAndSet}. |
106 |
|
* |
107 |
|
* @param obj An object whose field to conditionally set |
108 |
|
* @param expect the expected value |