1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-16 22:35:03 -05:00

Added thread locking for sorting queue's

This commit is contained in:
echel0n 2014-06-01 18:16:25 -07:00
parent 44d45ca760
commit 41a9e08155

View File

@ -41,6 +41,8 @@ class GenericQueue(object):
self.currentItem = None
self.lock = threading.Lock()
def pause(self):
logger.log(u"Pausing queue")
self.min_priority = 999999999999
@ -83,7 +85,8 @@ class GenericQueue(object):
else:
return y.priority-x.priority
self.queue.sort(cmp=sorter)
with self.lock:
self.queue.sort(cmp=sorter)
queueItem = self.queue[0]