load
Atomically loads the value from this AtomicReference.
Since Kotlin
2.1Samples
import kotlin.concurrent.atomics.*
import kotlin.concurrent.thread
fun main() {
//sampleStart
val a = AtomicReference("aaa")
println(a.load()) // aaa
//sampleEnd
}
Atomically loads the value from this AtomicReference.
Has the same memory effects as java.util.concurrent.atomic.AtomicReference.get.