prevent deadlocks by shutting down services in correct order

This commit is contained in:
Jakob Ketterl 2019-10-31 19:13:33 +01:00
parent 1638fde181
commit af1a99c130

View File

@ -284,11 +284,14 @@ class ServiceHandler(object):
resampler_props["samp_rate"] = bw + 24000 resampler_props["samp_rate"] = bw + 24000
resampler = Resampler(resampler_props, self.getAvailablePort(), self.source) resampler = Resampler(resampler_props, self.getAvailablePort(), self.source)
resampler.start() resampler.start()
self.services.append(resampler)
for dial in group: for dial in group:
self.services.append(self.setupService(dial["mode"], dial["frequency"], resampler)) self.services.append(self.setupService(dial["mode"], dial["frequency"], resampler))
# resampler goes in after the services since it must not be shutdown as long as the services are still running
self.services.append(resampler)
def optimizeResampling(self, freqs, bandwidth): def optimizeResampling(self, freqs, bandwidth):
freqs = sorted(freqs, key=lambda f: f["frequency"]) freqs = sorted(freqs, key=lambda f: f["frequency"])
distances = [ distances = [