Atomic access to a long value which may be read and updated by multiple
threads without explicit sychronization.
Depending on the capability of the hardware we are running on, this class
may be implemented using Java-level locks, an 8-byte compare-and-swap or a
written by: Doug Lea (email@example.com)
Get the current value, with VOLATILE-ACQUIRE memory semantics.
public abstract boolean attemptUpdate(long oldValue,
Attempt to set the value to newValue only if it is currently oldValue.
This will always fail if another thread changes the value
to a different value between commencement and completion
of the attempted update, and MAY succeed otherwise.
If committed, the operation has VOLATILE-RELEASE semantics.
This can be implemented using CAS and with locks in the
obvious way. It can be implemented using LL/SC via
if (LoadLLinked(&value) == oldValue)