always release queue lock

This commit is contained in:
Clint Armstrong
2015-09-02 15:23:47 -04:00
parent 5b647d8e70
commit b0e7c9346b

View File

@@ -215,11 +215,11 @@ def getThreadActionLock(device_id, action):
for thread_cursor in thread_cursors: for thread_cursor in thread_cursors:
if thread_cursor.in_use == 'queue.{0}'.format(device_id): if thread_cursor.in_use == 'queue.{0}'.format(device_id):
thread_cursor.in_use = '{0}.{1}'.format(action, device_id) thread_cursor.in_use = '{0}.{1}'.format(action, device_id)
releaseLock('queue.{0}'.format(device_id), thread_cursor.cursor)
if getLock('{0}.{1}'.format(action, device_id), thread_cursor.cursor): if getLock('{0}.{1}'.format(action, device_id), thread_cursor.cursor):
return True return True
else: else:
thread_cursor.in_use = False thread_cursor.in_use = False
releaseLock('queue.{0}'.format(device_id), thread_cursor.cursor)
return False return False
return False return False