Siddarth Kumar 926f6a3c72 Revert "test: bump go-libp2p"
This reverts commit d0ca4447c6c5642830354740d045f453eb3e77e8.
2024-01-18 20:29:33 +00:00

29 lines
414 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
}
func (b *atomicBool) swap(value bool) bool {
var i int32 = 0
if value {
i = 1
}
return atomic.SwapInt32(&(b.val), i) != 0
}