updateAndGet

inline fun <V> Atomic<V>.updateAndGet(function: (V) -> V): V
inline fun AtomicBoolean.updateAndGet(function: (Boolean) -> Boolean): Boolean
inline fun AtomicInt.updateAndGet(function: (Int) -> Int): Int
inline fun AtomicLong.updateAndGet(function: (Long) -> Long): Long

Updates variable atomically using the specified function of its value and returns its new value.