Are there any examples of how to use GCD from iOS ...
# multiplatform
t
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
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
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
Thanks for the advice. I'll give that a try.
👍 1