Fix waiting for tasks
The change to avoid duplicate tasks in a queue had an error where it would cause all tasks to be immediately marked as completed. This caused the synchronous task waits on actions such as immediate sync of a single change to return early, before actual completion. This may have caused other errors as well. Change-Id: Ie000a1242db17b1bed8c2eac919e242225f5bba6
This commit is contained in:
parent
46155d86a3
commit
1226ef8d57
@ -64,13 +64,16 @@ class MultiQueue(object):
|
||||
return count
|
||||
|
||||
def put(self, item, priority):
|
||||
added = False
|
||||
self.condition.acquire()
|
||||
try:
|
||||
if item not in self.queues[priority]:
|
||||
self.queues[priority].append(item)
|
||||
added = True
|
||||
self.condition.notify()
|
||||
finally:
|
||||
self.condition.release()
|
||||
return added
|
||||
|
||||
def get(self):
|
||||
self.condition.acquire()
|
||||
|
Loading…
Reference in New Issue
Block a user