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 { func IsVsyncEnabled() bool {
r := false
u := currentUI u := currentUI
_ = u.runOnMainThread(func() error { u.m.Lock()
r = currentUI.vsync r := u.vsync
return nil u.m.Unlock()
})
return r return r
} }