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