Can I run a macOS dispatchLoop from `macosX64Test`...
# kotlin-native
m
Can I run a macOS dispatchLoop from
macosX64Test
? I tried calling
dispatch_main
manually but it gave me a
Illegal instruction: 4
Actually, I tried to call
dispatch_main
from a regular kotlin cli without success: See https://github.com/martinbonnin/kmpCli for an exemple
b
replace
dispatch_main
call with
CFRunLoopRun()
and your code will run
👍 1
Per Roman,
CFRunLoopRun
runs the darwin event loop (https://github.com/Kotlin/kotlinx.coroutines/issues/1831#issuecomment-603711857)
m
Indeed, thanks!