public BlockingAsyncProcedure(ReadGraphImpl graph, AsyncProcedure<Result> procedure, Object key) {
this.procedure = procedure;
this.key = key;
- this.graph = ReadGraphImpl.newAsync(graph);
+ this.graph = graph;
this.graph.asyncBarrier.inc();
}
}
}
+ public void waitBarrier() {
+ graph.asyncBarrier.waitBarrier(key, graph);
+ }
+
@SuppressWarnings("unchecked")
public Result get() throws DatabaseException {
}
+ public boolean isDone() {
+ return graph.asyncBarrier.get() == 0;
+ }
+
@SuppressWarnings("unchecked")
public Result getResult() {
return (Result)result;