FreezableAtomicReference
Note: this class is useful only with legacy memory manager. Please use AtomicReference instead.
An atomic reference to a Kotlin object. Can be used in concurrent scenarious, but must be frozen first, otherwise behaves as regular box for the value. If frozen, shall be zeroed out once no longer needed. Otherwise memory leak could happen. To detect such leaks kotlin.native.runtime.GC.detectCycles in debug mode could be helpful.
Constructors
<init>
Note: this class is useful only with legacy memory manager. Please use AtomicReference instead.
FreezableAtomicReference(value_: T)
Properties
Functions
compareAndSet
Atomically sets the value to the given new value if the current value equals the expected value and returns true if operation was successful.
fun compareAndSet(expected: T, newValue: T): Boolean
compareAndSwap
Atomically sets the value to the given new value if the current value equals the expected value and returns the old value in any case.
fun compareAndSwap(expected: T, newValue: T): T
toString
Returns the string representation of this object.
fun toString(): String