sdr: capture state locally prior to processing

pull/326/head
Joseph Poirier 2016-03-14 15:47:33 -05:00
rodzic 529b453ba2
commit c5aacf0fbd
1 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -486,6 +486,9 @@ func sdrWatcher() {
shutdownES = false shutdownES = false
} }
// capture current state
esEnabled := esEnabled
uatEnabled := uatEnabled
count := rtl.GetDeviceCount() count := rtl.GetDeviceCount()
atomic.StoreUint32(&globalStatus.Devices, uint32(count)) atomic.StoreUint32(&globalStatus.Devices, uint32(count))
@ -494,8 +497,7 @@ func sdrWatcher() {
count = 2 count = 2
} }
if count == prevCount && prevESEnabled == globalSettings.ES_Enabled && if count == prevCount && prevESEnabled == esEnabled && prevUATEnabled == uatEnabled {
prevUATEnabled == globalSettings.UAT_Enabled {
continue continue
} }
@ -508,11 +510,11 @@ func sdrWatcher() {
ESDev.shutdown() ESDev.shutdown()
ESDev = nil ESDev = nil
} }
configDevices(count, globalSettings.ES_Enabled, globalSettings.UAT_Enabled) configDevices(count, esEnabled, uatEnabled)
prevCount = count prevCount = count
prevUATEnabled = globalSettings.UAT_Enabled prevUATEnabled = uatEnabled
prevESEnabled = globalSettings.ES_Enabled prevESEnabled = esEnabled
} }
} }