Move queue and wait variables to __init__.
Turns out threading.start() returns before the thread actually starts, so there were situations in which we would start the thread and immediately try to use it before run() happened.
This commit is contained in:
@@ -223,16 +223,11 @@ class PriceWorkerThread(threading.Thread):
|
||||
def __init__(self):
|
||||
threading.Thread.__init__(self)
|
||||
self.name = "PriceWorker"
|
||||
self.queue = Queue.Queue()
|
||||
self.wait = {}
|
||||
pyfalog.debug("Initialize PriceWorkerThread.")
|
||||
|
||||
def run(self):
|
||||
pyfalog.debug("Run start")
|
||||
self.queue = Queue.Queue()
|
||||
self.wait = {}
|
||||
self.processUpdates()
|
||||
pyfalog.debug("Run end")
|
||||
|
||||
def processUpdates(self):
|
||||
queue = self.queue
|
||||
while True:
|
||||
# Grab our data
|
||||
|
||||
Reference in New Issue
Block a user