Put setDaemon inside init.
This commit is contained in:
parent
9fa90ccc3f
commit
284b3a24f7
|
@ -13,6 +13,7 @@ class bgWorker(threading.Thread):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
self.q = Queue.Queue()
|
self.q = Queue.Queue()
|
||||||
|
self.setDaemon(True)
|
||||||
|
|
||||||
def post(self,job):
|
def post(self,job):
|
||||||
self.q.put(job)
|
self.q.put(job)
|
||||||
|
@ -34,5 +35,4 @@ class bgWorker(threading.Thread):
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
|
|
||||||
bgworker = bgWorker()
|
bgworker = bgWorker()
|
||||||
bgworker.setDaemon(True)
|
|
||||||
bgworker.start()
|
bgworker.start()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user