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:
parent
44d45ca760
commit
41a9e08155
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user