mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 23:26:58 +08:00
21 lines
283 B
Go
21 lines
283 B
Go
package webrtc
|
|
|
|
import "sync/atomic"
|
|
|
|
type atomicBool struct {
|
|
val int32
|
|
}
|
|
|
|
func (b *atomicBool) set(value bool) { // nolint: unparam
|
|
var i int32
|
|
if value {
|
|
i = 1
|
|
}
|
|
|
|
atomic.StoreInt32(&(b.val), i)
|
|
}
|
|
|
|
func (b *atomicBool) get() bool {
|
|
return atomic.LoadInt32(&(b.val)) != 0
|
|
}
|