MCPcopy Create free account
hub / github.com/coyim/coyim / assertInUIThread

Function assertInUIThread

gui/ui_thread.go:8–12  ·  view source on GitHub ↗

TODO: could this use a compiling flag to generate a noop function when released?

()

Source from the content-addressed store, hash-verified

6
7//TODO: could this use a compiling flag to generate a noop function when released?
8func assertInUIThread() {
9 if g.glib.MainDepth() == 0 {
10 panic("This function has to be called from the UI thread")
11 }
12}
13
14//GTK process events in glib event loop (see [1]). In order to keep the UI
15//responsive, it is a good practice to not block long running tasks in a signal's

Calls 1

MainDepthMethod · 0.80