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 <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-09-09 14:47:35 +02:00
parent 93409a784d
commit 5eef85f5cd
+1
View File
@@ -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{}{}: