mirror of
https://github.com/pion/webrtc.git
synced 2025-12-24 11:51:03 +08:00
This reverts commit 6c3620093d.
This commit would cause sender.ReadRTCP() to never return
even when pc associated with this sender was closed.
The aftermath is leaked goroutines that will never stop.
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
|
|
}
|