What is the difference between kotlin.native.concu...
# kotlin-native
p
What is the difference between kotlin.native.concurrent.AtomicInt and kotlinx.atomicfu.AtomicInt? I was trying to create an iOS framework using the first one and it errored with this message
"Compilation failed: no implementation for @kotlin.native.Symbol Name public final external fun compareAndSet(expected: kotlin.Int, new: kotlin.Int): kotlin.Boolean defined in kotlin.native.concurrent.AtomicInt[DeserializedSimpleFunctionDescriptor@7f4a1cac] in deserialized class AtomicInt"
but the second one passed. I see that there is no implementation in the class in the first case while there is one in the latter.
e
kotlin.native.concurrent.AtomicInt
is only available in Kotlin/Native. You cannot use it on JVM, for example. While
kotlinx.atomicfu.AtomicInt
is cross-platform wrapper that is available on JVM, JS, Native. Currently, it is just a stub on Native (does not provide actually actual atomicity like the former class)
p
So I should be able to use kotlin.native.concurrent.AtomicInt while creating a framework for iOS (because it uses K/N) but the error wont let me create the framework. Is there anything I am missing?
I was able to compile successfully after cleaning
👍 1