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