mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
audio/internal/cbackend: bug fix: use CompareAndSwap
This commit is contained in:
parent
35f268dfc3
commit
6a1c17b06f
@ -395,8 +395,6 @@ func (p *playerImpl) readSourceToBuffer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *playerImpl) setErrorImpl(err error) {
|
func (p *playerImpl) setErrorImpl(err error) {
|
||||||
if p.err.Load() == nil {
|
p.err.CompareAndSwap(nil, err)
|
||||||
p.err.Store(err)
|
|
||||||
}
|
|
||||||
p.closeImpl()
|
p.closeImpl()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user