kotlin-stdlib / kotlin.concurrent / AtomicReference / getAndSet getAndSet Native 1.3 fun getAndSet(newValue: T): T(source) Atomically sets the value to the given new value and returns the old value.