提交 19f6e7df authored 作者: Andrei Tokar's avatar Andrei Tokar

fix missed lock release

上级 b1c3ad66
...@@ -1924,15 +1924,17 @@ public class MVStore { ...@@ -1924,15 +1924,17 @@ public class MVStore {
// We can't wait fo lock here, because if called from the background thread, // We can't wait fo lock here, because if called from the background thread,
// it might go into deadlock with concurrent database closure // it might go into deadlock with concurrent database closure
// and attempt to stop this thread. // and attempt to stop this thread.
if (storeLock.tryLock() && !compactInProgress) { if (storeLock.tryLock()) {
try { try {
compactInProgress = true; if (!compactInProgress) {
ArrayList<Chunk> old = findOldChunks(targetFillRate, write); compactInProgress = true;
if (old == null || old.isEmpty()) { ArrayList<Chunk> old = findOldChunks(targetFillRate, write);
return false; if (old == null || old.isEmpty()) {
return false;
}
compactRewrite(old);
return true;
} }
compactRewrite(old);
return true;
} finally { } finally {
compactInProgress = false; compactInProgress = false;
storeLock.unlock(); storeLock.unlock();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论