internal/ui: bug fix: use CompareAndSwap

This commit is contained in:
Hajime Hoshi 2022-03-07 23:51:10 +09:00
parent 518e7f7022
commit 86ba7719eb

View File

@ -190,10 +190,7 @@ func (g *globalState) error() error {
} }
func (g *globalState) setError(err error) { func (g *globalState) setError(err error) {
if g.err_.Load() != nil { g.err_.CompareAndSwap(nil, err)
return
}
g.err_.Store(err)
} }
func (g *globalState) fpsMode() FPSModeType { func (g *globalState) fpsMode() FPSModeType {