Wideband autonomous SDR analysis engine forked from sdr-visual-suite
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package main
-
- import "sync"
-
- type phaseSnapshot struct {
- mu sync.RWMutex
- state phaseState
- }
-
- func (p *phaseSnapshot) Set(state phaseState) {
- if p == nil {
- return
- }
- p.mu.Lock()
- p.state = state
- p.mu.Unlock()
- }
-
- func (p *phaseSnapshot) Snapshot() phaseState {
- if p == nil {
- return phaseState{}
- }
- p.mu.RLock()
- state := p.state
- p.mu.RUnlock()
- return state
- }
|