bitbake: 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.

(Bitbake rev: 4fbef87adaca2df8c1e877aec5588c2e5466f252)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2024-10-11 11:58:48 +01:00
parent 39400c4a2b
commit ba2fcb968e

View File

@@ -446,6 +446,7 @@ def fileslocked(files, *args, **kwargs):
try:
yield
finally:
locks.reverse()
for lock in locks:
bb.utils.unlockfile(lock)