forked from joejulian/gio
6553915e59
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>
12 lines
212 B
Objective-C
12 lines
212 B
Objective-C
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#include "_cgo_export.h"
|
|
|
|
void gio_runOnMain(uintptr_t h) {
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
gio_runFunc(h);
|
|
});
|
|
}
|