Merge "When renaming the lock file succeeds the lock isn't held anymore"

This commit is contained in:
Robin Rosenberg 2013-03-28 15:57:38 -04:00 committed by Gerrit Code Review @ Eclipse.org
commit 4796fe7043
1 changed files with 8 additions and 3 deletions

View File

@ -437,11 +437,16 @@ public boolean commit() {
} }
saveStatInformation(); saveStatInformation();
if (lck.renameTo(ref)) if (lck.renameTo(ref)) {
haveLck = false;
return true; return true;
if (!ref.exists() || deleteRef()) }
if (renameLock()) if (!ref.exists() || deleteRef()) {
if (renameLock()) {
haveLck = false;
return true; return true;
}
}
unlock(); unlock();
return false; return false;
} }