load

expect fun load(): Int(source)

Atomically loads the value from this AtomicInt.

Since Kotlin

2.1

Samples

import kotlin.concurrent.atomics.*
import kotlin.concurrent.thread

fun main() { 
   //sampleStart 
   val a = AtomicInt(7)
println(a.load()) // 7 
   //sampleEnd
}
actual fun load(): Int(source)

Atomically loads the value from this AtomicInt.

Since Kotlin

2.1
actual fun load(): Int(source)

Atomically loads the value from this AtomicInt.

Has the same memory effects as java.util.concurrent.atomic.AtomicInteger.get.

Since Kotlin

2.1
actual fun load(): Int(source)

Atomically loads the value from this AtomicInt.

Since Kotlin

2.1
actual fun load(): Int(source)

Atomically loads the value from this AtomicInt.

Since Kotlin

2.1
actual fun load(): Int(source)

Atomically loads the value from this AtomicInt.

Since Kotlin

2.1