Make VanillaChronicleHash.close() to wait until concurrent threads accessing the hash finish their work and don't permit new threads to come while close() is in progress and after that

This commit is contained in:
leventov
2016-07-17 23:25:49 +07:00
parent b3c1f7b1e2
commit 7ada09a8dc
12 changed files with 322 additions and 32 deletions
@@ -563,6 +563,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
queryContext = cxt.get();
if (queryContext == null) {
queryContext = new CompiledReplicatedMapQueryContext<>(ReplicatedChronicleMap.this);
addContext(queryContext);
cxt.set(queryContext);
}
return queryContext;
@@ -597,6 +598,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
iterContext = cxt.get();
if (iterContext == null) {
iterContext = new CompiledReplicatedMapIterationContext<>(ReplicatedChronicleMap.this);
addContext(iterContext);
cxt.set(iterContext);
}
return iterContext;