From 5eef85f5cd1be18c1308f6726886bb9c61ff9601 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 9 Sep 2019 14:47:35 +0200 Subject: [PATCH] ui/app: note that Window.Invalidate is safe for concurrent use Invalidate is intended to be called as a result of external events, which might very well be from a different goroutine than the one driving the window. Signed-off-by: Elias Naur --- ui/app/window.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/app/window.go b/ui/app/window.go index 51b016ec..0854d400 100644 --- a/ui/app/window.go +++ b/ui/app/window.go @@ -158,6 +158,7 @@ func (w *Window) draw(size image.Point, frame *ui.Ops) { // Invalidate the window such that a UpdateEvent will be generated // immediately. If the window is inactive, the event is sent when the // window becomes active. +// Invalidate is safe for concurrent use. func (w *Window) Invalidate() { select { case w.invalidates <- struct{}{}: