From 5cfefaf1a2fc73ea1db89ddcff423604935d85d1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 20 Feb 2016 04:08:06 +0900 Subject: [PATCH] graphics: Refactoring: remove ui goroutines --- internal/ui/ui_glfw.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 273284d22..5ae88e075 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -49,13 +49,7 @@ func Init() { u := &userInterface{ window: window, - funcs: make(chan func()), } - go func() { - for f := range u.funcs { - f() - } - }() go func() { runtime.LockOSThread() u.window.MakeContextCurrent() @@ -67,13 +61,7 @@ func Init() { } func ExecOnUIThread(f func()) { - // TODO: Rename this function: f is actually NOT executed on UI threads - ch := make(chan struct{}) - currentUI.funcs <- func() { - defer close(ch) - f() - } - <-ch + f() } func Start(width, height, scale int, title string) (actualScale int, err error) { @@ -112,7 +100,6 @@ type userInterface struct { height int scale int actualScale int - funcs chan func() } func (u *userInterface) start(width, height, scale int, title string) (actualScale int, err error) {