提交 474ed5bc authored 作者: Andrei Tokar's avatar Andrei Tokar

added missing check for commit in MVMap append mode

上级 1293f1e9
......@@ -780,7 +780,8 @@ public class MVMap<K, V> extends AbstractMap<K, V>
public final RootReference getRoot() {
RootReference rootReference = getRootInternal();
return singleWriter ? flushAppendBuffer(rootReference) : rootReference;
return singleWriter && rootReference.getAppendCounter() > 0 ?
flushAppendBuffer(rootReference) : rootReference;
}
private RootReference getRootInternal() {
......@@ -1181,6 +1182,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
* @return potentially updated RootReference
*/
private RootReference flushAppendBuffer(RootReference rootReference) {
beforeWrite();
int attempt = 0;
int keyCount;
while((keyCount = rootReference.getAppendCounter()) > 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论