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:
James E. Blair 2015-06-04 09:20:40 -07:00
parent 46155d86a3
commit 1226ef8d57
1 changed files with 3 additions and 0 deletions

View File

@ -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()