Commit 150519ad authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

Made method lock safe

parent 3073f0b4
......@@ -214,9 +214,11 @@ class RunningTransfersSet(object):
def setProcess(self, transferid, process):
'''set the process object to the existing running transfer'''
self.lock.acquire()
t = self.get(transferid)
t.process = process
self.lock.release()
try:
t = self.get(transferid)
t.process = process
finally:
self.lock.release()
def remove(self, transferIds):
'''removes a transfer from the list, and kills corresponding process, when possible'''
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment