updateAndGet

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

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