inline fun <T> AtomicReference<T>.atomicSet(crossinline block: (T) -> T): T
Atomically updates a reference with the logic provided in the code block. The code block should be free of side-effects as it may be run multiple times. The initial value of the reference is passed to the code block and should be used for manipulation.
block - The code block to run.
Return
The reference value after the update has been applied.