lock on dsp to avoid race conditions
This commit is contained in:
parent
0c7b0d2eaa
commit
118335b2b6
@ -140,6 +140,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||
super().__init__(conn)
|
||||
|
||||
self.dsp = None
|
||||
self.dspLock = threading.Lock()
|
||||
self.sdr = None
|
||||
self.configSubs = []
|
||||
self.bookmarkSub = None
|
||||
@ -351,6 +352,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||
super().close()
|
||||
|
||||
def stopDsp(self):
|
||||
with self.dspLock:
|
||||
if self.dsp is not None:
|
||||
self.dsp.stop()
|
||||
self.dsp = None
|
||||
@ -358,6 +360,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||
self.sdr.removeSpectrumClient(self)
|
||||
|
||||
def getDsp(self):
|
||||
with self.dspLock:
|
||||
if self.dsp is None and self.sdr is not None:
|
||||
self.dsp = DspManager(self, self.sdr)
|
||||
return self.dsp
|
||||
|
Loading…
Reference in New Issue
Block a user