Improve thread handling

This commit is contained in:
Klaus-Uwe Mitterer 2017-10-30 14:47:53 +01:00
parent e5130da9e5
commit f916cca064
1 changed files with 2 additions and 2 deletions

View File

@ -41,12 +41,12 @@ if __name__ == "__main__":
threads = []
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()
threads += [t]
for t in threads:
t.join()
t.join(10)
if not eq.empty():
exc = eq.get()