utils: Improve multiple lock handling
PATCH 1/1 utils: Improve multiple lock handling
We should release locks in the opposite order to the order we locked them in to avoid potentially problematic behaviour. This hasn't been observed with our current usage and is just a preventative improvement.
Signed-off-by Richard Purdie <[email protected]>
--- lib/bb/utils.py | 1 + 1 file changed, 1 insertion(+)
lib/bb/utils.py +1 -0
@@ -446,6 +446,7 @@ def fileslocked(files, *args, **kwargs): try: yield finally: + locks.reverse() for lock in locks: bb.utils.unlockfile(lock)