https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
t

Trey

07/13/2022, 9:04 PM
Are there any examples of how to use GCD from iOS via Kotlin? I'm trying to work out a few issues and that would be helpful.
t

Trey

07/13/2022, 9:16 PM
Thanks, that's helpful. I'm trying to create a serial queue and I'm trying to work out how to access DISPATCH_QUEUE_SERIAL. I didn't see any place that your code does that. Did I miss it? Looks like it just uses system queues.
m

mbonnin

07/13/2022, 10:00 PM
So you might make it work by passing just "null"
Copy code
dispatch_queue_create("myqueue", null)
That doesn't solve the more general issue though 😅
I would try something in the likes of this in the general case:
Copy code
dispatch_queue_create("myqueue", DISPATCH_QUEUE_SERIAL!!.reinterpret<dispatch_queue_attr_tVar>().pointed.value)
Well, actually more like
Copy code
dispatch_queue_create("myqueue", DISPATCH_QUEUE_SERIAL?.reinterpret<dispatch_queue_attr_tVar>()?.pointed?.value)
(but I haven't tested any of this)
t

Trey

07/14/2022, 2:28 PM
Thanks for the advice. I'll give that a try.
👍 1
23 Views