audio/internal/cbackend: bug fix: use CompareAndSwap

This commit is contained in:
Hajime Hoshi 2022-03-07 23:45:42 +09:00
parent 35f268dfc3
commit 6a1c17b06f

View File

@ -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()
} }