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

fix missed lock release

上级 b1c3ad66
...@@ -1924,8 +1924,9 @@ public class MVStore { ...@@ -1924,8 +1924,9 @@ 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 {
if (!compactInProgress) {
compactInProgress = true; compactInProgress = true;
ArrayList<Chunk> old = findOldChunks(targetFillRate, write); ArrayList<Chunk> old = findOldChunks(targetFillRate, write);
if (old == null || old.isEmpty()) { if (old == null || old.isEmpty()) {
...@@ -1933,6 +1934,7 @@ public class MVStore { ...@@ -1933,6 +1934,7 @@ public class MVStore {
} }
compactRewrite(old); compactRewrite(old);
return true; return true;
}
} finally { } finally {
compactInProgress = false; compactInProgress = false;
storeLock.unlock(); storeLock.unlock();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论