app: [macOS/iOS] simplify running functions in the main thread

Using cgo.Handle allows us to pass a reference to a Go function through
the GCD API for running main thread code, saving a goroutine and a channel.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2025-09-10 22:55:16 +02:00
parent 4c0e526c0b
commit 6553915e59
2 changed files with 11 additions and 19 deletions
+2 -2
View File
@@ -4,8 +4,8 @@
#include "_cgo_export.h"
void gio_wakeupMainThread(void) {
void gio_runOnMain(uintptr_t h) {
dispatch_async(dispatch_get_main_queue(), ^{
gio_dispatchMainFuncs();
gio_runFunc(h);
});
}