hello guys, is it possible to offer values to a `B...
# kotlin-native
m
hello guys, is it possible to offer values to a
BroadcastChannel
from other thread in kotlin native?
Copy code
val myOtherQueue = dispatch_queue_create("my_other_queue")

val myChannel = ConflatedBroadcastChannel(Unit)

val myChannelPointer = StableRef.create(myChannel)

val callback = staticCFunction { value: SomeClass, info: COpaquePointer? ->
    if (info == null) { return@staticCFunction }
    info.asStableRef<ConflatedBroadcastChannel<Unit>>().get().offer(Unit) // not working: EXC_BAD_ACCESS!
}

SomeNativeApi(myOtherQueue, callback, myChannelPointer.asCPointer())
The problem here is I'm trying to offer value to a
ConflatedBroadcastChannel
from other thread than the main thread, right? if so, how to solve it?