Example #1
0
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()
}
Example #2
0
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")
}
Example #3
0
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()
}
Example #4
0
File: x11.go Project: Miaque/mojo
func run(callbacks Callbacks) {
	runtime.LockOSThread()
	cb = callbacks
	C.runApp()
}