opengl: Refactoring: More similar way to golang.org/x/mobile/app

This commit is contained in:
Hajime Hoshi 2018-03-25 18:23:34 +09:00
parent c47b549fd1
commit c0b1919020

View File

@ -93,12 +93,13 @@ func (c *Context) DoWork(chError <-chan error, chDone <-chan struct{}) error {
panic("not reached")
}
// TODO: Check this is called on the rendering thread
workAvailable := c.worker.WorkAvailable()
loop:
for {
select {
case err := <-chError:
return err
case <-c.worker.WorkAvailable():
case <-workAvailable:
c.worker.DoWork()
case <-chDone:
break loop