Atomic reference
Update value by AtomicRef.compareAndSet and then return the old value.
Update value by AtomicRef.compareAndSet and then return the new value.