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

fix missed lock release

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