mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Added thread locking for sorting queue's
This commit is contained in:
parent
44d45ca760
commit
41a9e08155
1 changed files with 4 additions and 1 deletions
|
@ -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 a new issue