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

fix missed lock release

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