Added some extra documentation to QueueMain. Fixes #164.

This commit is contained in:
Pietro Gagliardi 2018-03-27 20:19:27 -04:00
parent 8716bfd161
commit 6c3bda44d3
1 changed files with 8 additions and 0 deletions

View File

@ -79,6 +79,14 @@ var (
// primary purpose is to allow communication between other
// goroutines and the GUI thread. Calling QueueMain after Quit
// has been called results in undefined behavior.
//
// If you start a goroutine in f, it also cannot call package ui
// functions. So for instance, the following will result in
// undefined behavior:
//
// ui.QueueMain(func() {
// go ui.MsgBox(...)
// })
func QueueMain(f func()) {
qmlock.Lock()
defer qmlock.Unlock()