Commit 8a2941c4 authored by Guido Trotter's avatar Guido Trotter
Browse files

Processor: lock all levels even if one is missing

If a locking level wasn't specified locking used to stop. This means
that if one, for example, didn't specify anything at the LEVEL_INSTANCE
level, no locks at the LEVEL_NODE level were acquired either. With this
patch we force _LockAndExecLU to be called for all existing levels, and
break the recursion if the level doesn't exist in locking.LEVELS.

Reviewed-by: imsnah
parent 0fcc5db3
......@@ -129,7 +129,9 @@ class Processor(object):
given LU and its opcodes.
"""
if level in lu.needed_locks:
if level not in locking.LEVELS:
result = self._ExecLU(lu)
elif level in lu.needed_locks:
# This gives a chance to LUs to make last-minute changes after acquiring
# locks at any preceding level.
lu.DeclareLocks(level)
......@@ -146,7 +148,7 @@ class Processor(object):
if lu.needed_locks[level]:
self.context.glm.release(level)
else:
result = self._ExecLU(lu)
result = self._LockAndExecLU(lu, level + 1)
return result
......
Markdown is supported
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