mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/ui: bug fix: use CompareAndSwap
This commit is contained in:
parent
518e7f7022
commit
86ba7719eb
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user