de-duplicate; better logging

This commit is contained in:
Jakob Ketterl
2019-07-28 11:40:58 +02:00
parent 7689e31640
commit a15e625692
3 changed files with 20 additions and 37 deletions

View File

@ -515,20 +515,7 @@ class DspManager(csdr.output):
}
write = writers[t]
def pump(read, write):
def copy():
run = True
while run:
data = read()
if data is None or (isinstance(data, bytes) and len(data) == 0):
logger.warning("zero read on {0}".format(t))
run = False
else:
write(data)
return copy
threading.Thread(target=pump(read_fn, write)).start()
threading.Thread(target=self.pump(read_fn, write)).start()
def stop(self):
self.dsp.stop()