compareAndSet
Store a new value only if the current value is still the expected one, and say whether it worked.
An atomic conditional update (backed by a processor instruction); updateAndGet and similar methods retry a compareAndSet loop, so their functions may run more than once.
See also