mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 09:19:31 +00:00
Merge pull request #561 from ThomasWaldmann/fix-locking
fix locking, partial fix for #502
This commit is contained in:
commit
c667d330b4
1 changed files with 3 additions and 1 deletions
|
@ -278,9 +278,11 @@ def _wait_for_readers_finishing(self, remove, sleep):
|
|||
try:
|
||||
if remove is not None:
|
||||
self._roster.modify(remove, REMOVE)
|
||||
remove = None
|
||||
if len(self._roster.get(SHARED)) == 0:
|
||||
return # we are the only one and we keep the lock!
|
||||
# restore the roster state as before (undo the roster change):
|
||||
if remove is not None:
|
||||
self._roster.modify(remove, ADD)
|
||||
except:
|
||||
# avoid orphan lock when an exception happens here, e.g. Ctrl-C!
|
||||
self._lock.release()
|
||||
|
|
Loading…
Reference in a new issue