Revision 0cc00929 lib/locking.py
b/lib/locking.py | ||
---|---|---|
389 | 389 |
except (KeyError): |
390 | 390 |
raise errors.LockError('non-existing lock in set (%s)' % lname) |
391 | 391 |
|
392 |
# This will hold the locknames we effectively acquired. |
|
393 |
acquired = set() |
|
392 | 394 |
# Now acquire_list contains a sorted list of resources and locks we want. |
393 | 395 |
# In order to get them we loop on this (private) list and acquire() them. |
394 | 396 |
# We gave no real guarantee they will still exist till this is done but |
... | ... | |
399 | 401 |
try: |
400 | 402 |
# now the lock cannot be deleted, we have it! |
401 | 403 |
self._add_owned(lname) |
404 |
acquired.add(lname) |
|
402 | 405 |
except: |
403 | 406 |
# We shouldn't have problems adding the lock to the owners list, but |
404 | 407 |
# if we did we'll try to release this lock and re-raise exception. |
... | ... | |
413 | 416 |
self._del_owned(lname) |
414 | 417 |
raise errors.LockError('non-existing lock in set (%s)' % name_fail) |
415 | 418 |
|
416 |
return True
|
|
419 |
return acquired
|
|
417 | 420 |
|
418 | 421 |
def release(self, names=None): |
419 | 422 |
"""Release a set of resource locks, at the same level. |
Also available in: Unified diff