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