Improve thread handling

This commit is contained in:
Klaus-Uwe Mitterer 2017-10-30 14:47:53 +01:00
parent e5130da9e5
commit f916cca064

View file

@ -41,12 +41,12 @@ if __name__ == "__main__":
threads = [] threads = []
for card in getFile(): for card in getFile():
t = threading.Thread(target=getBalance, args=(card["number"], card["ccn"], q, eq)) t = threading.Thread(target=getBalance, args=(card["number"], card["ccn"], q, eq), daemon=True)
t.start() t.start()
threads += [t] threads += [t]
for t in threads: for t in threads:
t.join() t.join(10)
if not eq.empty(): if not eq.empty():
exc = eq.get() exc = eq.get()