mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-08 11:03:38 +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.currentItem = None
|
||||||
|
|
||||||
|
self.lock = threading.Lock()
|
||||||
|
|
||||||
def pause(self):
|
def pause(self):
|
||||||
logger.log(u"Pausing queue")
|
logger.log(u"Pausing queue")
|
||||||
self.min_priority = 999999999999
|
self.min_priority = 999999999999
|
||||||
|
@ -83,7 +85,8 @@ class GenericQueue(object):
|
||||||
else:
|
else:
|
||||||
return y.priority-x.priority
|
return y.priority-x.priority
|
||||||
|
|
||||||
self.queue.sort(cmp=sorter)
|
with self.lock:
|
||||||
|
self.queue.sort(cmp=sorter)
|
||||||
|
|
||||||
queueItem = self.queue[0]
|
queueItem = self.queue[0]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue