直播:后台 JWT 推流、前台画中画;WebRTC 服务与 Nginx WebSocket 代理
Made-with: Cursor
This commit is contained in:
31
server/vendor/github.com/pion/webrtc/v3/atomicbool.go
generated
vendored
Normal file
31
server/vendor/github.com/pion/webrtc/v3/atomicbool.go
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
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
|
||||
if value {
|
||||
i = 1
|
||||
}
|
||||
return atomic.SwapInt32(&(b.val), i) != 0
|
||||
}
|
||||
Reference in New Issue
Block a user