ui: Bug fix: IsVsyncEnabled can cause deadlock

This commit is contained in:
Hajime Hoshi 2018-10-10 23:15:38 +09:00
parent b4a4b87b56
commit 34596bb1cf

View File

@ -350,12 +350,10 @@ func SetVsyncEnabled(enabled bool) {
}
func IsVsyncEnabled() bool {
r := false
u := currentUI
_ = u.runOnMainThread(func() error {
r = currentUI.vsync
return nil
})
u.m.Lock()
r := u.vsync
u.m.Unlock()
return r
}