mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +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