Note that the guarantees of the compareAndSet method in this class are weaker than in other atomic classes. Because this class cannot ensure that all uses of the field are appropriate for purposes of atomic access, it can guarantee atomicity only with respect to other invocations of compareAndSet and set on the same updater.
| Constructor Summary |
|---|
|
Protected do-nothing constructor for use by subclasses. |
| Method Summary | |
|---|---|
| long |
Atomically adds the given value to the current value of the field of the given object managed by this updater. |
| abstract boolean |
Atomically sets the field of the given object managed by this updater to the given updated value if the current value == the expected value. |
| long |
Atomically decrements by one the current value of the field of the given object managed by this updater. |
| abstract long |
Gets the current value held in the field of the given object managed by this updater. |
| long |
Atomically adds the given value to the current value of the field of the given object managed by this updater. |
| long |
Atomically decrements by one the current value of the field of the given object managed by this updater. |
| long |
Atomically increments by one the current value of the field of the given object managed by this updater. |
| long |
Atomically sets the field of the given object managed by this updater to the given value and returns the old value. |
| long |
Atomically increments by one the current value of the field of the given object managed by this updater. |
| abstract void |
Eventually sets the field of the given object managed by this updater to the given updated value. |
| static AtomicLongFieldUpdater<U> |
Creates and returns an updater for objects with the given field. |
| abstract void |
Sets the field of the given object managed by this updater to the given updated value. |
| abstract boolean |
Atomically sets the field of the given object managed by this updater to the given updated value if the current value == the expected value. |
| Methods inherited from java.langObject |
|---|
protected AtomicLongFieldUpdater
(
)
public
long
addAndGet
(
T
obj,
long
delta
)
public abstract
boolean
compareAndSet
(
T
obj,
long
expect,
long
update
)
public
long
decrementAndGet
(
T
obj
)
public abstract
long
get
(
T
obj
)
public
long
getAndAdd
(
T
obj,
long
delta
)
public
long
getAndDecrement
(
T
obj
)
public
long
getAndIncrement
(
T
obj
)
public
long
getAndSet
(
T
obj,
long
newValue
)
public
long
incrementAndGet
(
T
obj
)
public abstract
void
lazySet
(
T
obj,
long
newValue
)
public abstract
void
set
(
T
obj,
long
newValue
)
public abstract
boolean
weakCompareAndSet
(
T
obj,
long
expect,
long
update
)
May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet .