assert (request != null);
assert (procedure != null);
- processor.schedule(new SessionTask(this) {
+ processor.scheduleNow(new SessionTask(this) {
@Override
public void run0(int thread) {
assert (request != null);
assert (procedure != null);
- processor.schedule(new SessionTask(this) {
+ processor.scheduleNow(new SessionTask(this) {
@Override
public void run0(int thread) {
public boolean performPending() {
return processor.performPending(this);
}
-
+
public Set<ReadGraphImpl> ancestorSet() {
HashSet<ReadGraphImpl> result = new HashSet<>();
ReadGraphImpl g = this;
}
return result;
}
+
+ public int getLevel() {
+ return getLevelStatic(this);
+ }
+
+ private static int getLevelStatic(ReadGraphImpl impl) {
+ if(impl == null) return 0;
+ else return 1 + getLevelStatic(impl.parentGraph);
+ }
+
+ public ReadGraphImpl getTopLevelGraph() {
+ return getTopLevelGraphStatic(this);
+ }
+
+ private static ReadGraphImpl getTopLevelGraphStatic(ReadGraphImpl impl) {
+ if(impl.parentGraph == null) return impl;
+ else return getTopLevelGraphStatic(impl.parentGraph);
+ }
}