From a5421de8abbbc4ec7eb6236512e11a414669f9f5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 8 Feb 2019 20:32:00 -1000 Subject: [PATCH] mainthread: Add comments --- internal/mainthread/mainthread.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/mainthread/mainthread.go b/internal/mainthread/mainthread.go index 184b870b4..6491e3ee3 100644 --- a/internal/mainthread/mainthread.go +++ b/internal/mainthread/mainthread.go @@ -45,6 +45,8 @@ func Loop(ch <-chan error) error { } // 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 { if atomic.LoadInt32(&started) == 0 { // TODO: This can reach from other goroutine before Loop is called (#809).