Skip to content

FFI main thread blocking call #52106

@Zekfad

Description

@Zekfad

I'm trying to make an utility for OSX using Dart, that requires native code (I use objective-c to compile FFI compatible dylib).
Functions that I need (namely working with NSAppleEventManager) must execute on main OS thread, but it looks like Dart's event loop is blocking it permanently, so I cannot use dispatch_async(dispatch_get_main_queue(),^{}) or dispatch_sync (which will cause deadlock).
It's likely related to #37022, but I couldn't found an example or post that mentions main thread, only cross threading.
So is there any way to temporary pause Dart VM, execute native code and return to execution, in other words native interruption mechanism?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions