this.parentGraph = parentGraph;
this.parent = parent;
this.processor = support;
- this.asyncBarrier = new AsyncBarrierImpl(parentGraph != null ? parentGraph.asyncBarrier : null, parent, null);
+ this.asyncBarrier = prepareBarrier(parentGraph, parent, null, false);
}
ReadGraphImpl(ReadGraphImpl parentGraph, CacheEntry parent, QueryProcessor support, AsyncBarrierImpl asyncBarrier) {
this(graph, parent, graph.processor);
}
- ReadGraphImpl(ReadGraphImpl parentGraph, CacheEntry parent, Runnable callback) {
- this(parentGraph, parent, parentGraph.processor, new AsyncBarrierImpl(parentGraph != null ? parentGraph.asyncBarrier : null, parent, callback));
+ ReadGraphImpl(ReadGraphImpl parentGraph, CacheEntry parent, Runnable callback, boolean needsToBlock) {
+ this(parentGraph, parent, parentGraph.processor, prepareBarrier(parentGraph, parent, callback, needsToBlock));
}
+ static AsyncBarrierImpl prepareBarrier(ReadGraphImpl parentGraph, CacheEntry parent, Runnable callback, boolean needsToBlock) {
+ return new AsyncBarrierImpl(parentGraph != null ? parentGraph.asyncBarrier : null, parent, callback, needsToBlock);
+ }
+
ReadGraphImpl(ReadGraphImpl graph) {
this(graph, graph.parent);
}
- public ReadGraphImpl withParent(CacheEntry parent, Runnable callback) {
- return new ReadGraphImpl(this, parent, callback);
+ public ReadGraphImpl withParent(CacheEntry parent, Runnable callback, boolean needsToBlock) {
+ return new ReadGraphImpl(this, parent, callback, needsToBlock);
}
- public ReadGraphImpl withParent(CacheEntry parent) {
- return withParent(parent, null);
- }
+// public ReadGraphImpl withParent(CacheEntry parent) {
+// return withParent(parent, null);
+// }
public ReadGraphImpl syncWithParent(CacheEntry parent) {
return new ReadGraphImpl(this, parent, processor, null);