Use kotlin.concurrent.atomics.AtomicReference instead.
kotlin.concurrent.atomics.AtomicReference
An object reference that is always updated atomically.