func run(callbacks Callbacks) { if tid := uint64(C.threadID()); tid != initThreadID { log.Fatalf("app.Run called on thread %d, but app.init ran on %d", tid, initThreadID) } cb = callbacks C.runApp() }
func main(f func(App)) { if tid := uint64(C.threadID()); tid != initThreadID { log.Fatalf("app.Run called on thread %d, but app.init ran on %d", tid, initThreadID) } go func() { f(app{}) // TODO(crawshaw): trigger runApp to return }() C.runApp() panic("unexpected return from app.runApp") }
func main(f func(App)) { if tid := uint64(C.threadID()); tid != initThreadID { log.Fatalf("app.Main called on thread %d, but app.init ran on %d", tid, initThreadID) } go func() { f(app{}) C.stopApp() // TODO(crawshaw): trigger runApp to return }() C.runApp() }
func run(callbacks Callbacks) { runtime.LockOSThread() cb = callbacks C.runApp() }