Hi, can anybody tell me how to use [AtomicInt](<ht...
# multiplatform
w
Hi, can anybody tell me how to use [AtomicInt](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-atomic-int/) in common code?
m
As far as I know AtomitInt is available only for native target, so it cant be use in common code
😢 1
t
For atomics in common code, you probably want to use https://github.com/Kotlin/kotlinx.atomicfu
❤️ 1
a
Copy code
val int: AtomicInt = atomic(1)

// of just

val int = atomic(1)
👍 2
w
@travis @andylamax Thank you guys giving me this repository advice,This repository is hard for me to understand 😂. I resolved this problem by writing
expect
and
actual
combining method at last.In JVM using
AtomicInteger
330 Views