On this page
AtomicReference
class AtomicReference<T>
Wrapper around Kotlin object with atomic operations.
Legacy MM: An atomic reference to a frozen Kotlin object. Can be used in concurrent scenarious but frequently shall be of nullable type and be zeroed out once no longer needed. Otherwise memory leak could happen. To detect such leaks kotlin.native.internal.GC.detectCycles in debug mode could be helpful.
Constructors
<init>
Creates a new atomic reference pointing to given ref.
AtomicReference(value: T)
Properties
value
The referenced value. Gets the value or sets the new value. Legacy MM: if new value is not null, it must be frozen or permanent object.
var value: T
Functions
compareAndSet
compareAndSwap
toString
Returns the string representation of this object.
fun toString(): String
© 2010–2023 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-atomic-reference/