Perform legacy global lock in addition to new per-account lock

We simply lock OfflineImap the same global way that we have always done
in addition to the previously implemented per-account lock. We can keep
both systems in parallel and then after a few stable releases, drop the
old-style global lock. by reverting this patch

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2011-07-08 12:29:00 +02:00
parent 89c705bb26
commit 0d95651417
2 changed files with 18 additions and 1 deletions

View File

@ -172,6 +172,7 @@ class SyncableAccount(Account):
def lock(self):
"""Lock the account, throwing an exception if it is locked already"""
# Take a new-style per-account lock
self._lockfd = open(self._lockfilepath, 'w')
try:
fcntl.lockf(self._lockfd, fcntl.LOCK_EX|fcntl.LOCK_NB)