-
- private void addOrSet(ReadGraphImpl graph, final IntSet value, QueryProcessor provider) {
-
- assert(!isReady());
-
-// ArrayList<InternalProcedure<IntSet>> p = null;
-
- synchronized(this) {
-
- value.trim();
- setResult(value);
- setReady();
-// p = procs;
-// procs = null;
-
- }
-
-// if(p != null) {
-// IntSet v = (IntSet)getResult();
-// if(v != null) {
-// for(InternalProcedure<IntSet> proc : p) proc.execute(graph, v);
-// }
-// }
-
- }
-
- @Override
- public Object performFromCache(ReadGraphImpl graph, QueryProcessor provider, InternalProcedure<IntSet> procedure) {
-
- assert(isReady());
-
- if(handleException(graph, procedure)) return null;
-
- IntSet result = getResult();
-
- procedure.execute(graph, result);
-
- return result;
-
- }
-
- @Override
- public void recompute(ReadGraphImpl graph, QueryProcessor provider) {
-
- final Semaphore s = new Semaphore(0);
-
- computeForEach(graph, provider, new InternalProcedure<IntSet>() {
-
- @Override
- public void execute(ReadGraphImpl graph, IntSet result) {
- s.release();
- }
-
- @Override
- public void exception(ReadGraphImpl graph, Throwable t) {
- s.release();
- new Error("Error in recompute.", t).printStackTrace();
- }
-
- }, true);
-
- while(!s.tryAcquire()) {
- provider.resume(graph);
- }
-
- }
-
-
- @Override
- boolean isImmutable(ReadGraphImpl graph) {
- return graph.processor.isImmutable(id);
- }