mainthread: Add comments

This commit is contained in:
Hajime Hoshi 2019-02-08 20:32:00 -10:00
parent 87b4b8b1b4
commit a5421de8ab

View File

@ -45,6 +45,8 @@ func Loop(ch <-chan error) error {
} }
// Run calls f on the main thread. // Run calls f on the main thread.
//
// Do not call this from the main thread. This would block forever.
func Run(f func() error) error { func Run(f func() error) error {
if atomic.LoadInt32(&started) == 0 { if atomic.LoadInt32(&started) == 0 {
// TODO: This can reach from other goroutine before Loop is called (#809). // TODO: This can reach from other goroutine before Loop is called (#809).