X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2FBlockingAsyncProcedure.java;h=ad9f1643829fe506ac57125edaf2bc724a249d05;hp=4ae530317908ce32118b867edaa6c85b52932d0d;hb=277b1c7fb3fdd8effb4bf2b447358d0e4ef0e302;hpb=4aba159170fc72d39c2f930ea224aa71f4cdc2e7 diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java index 4ae530317..ad9f16438 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java @@ -31,7 +31,7 @@ public class BlockingAsyncProcedure implements AsyncProcedure { public BlockingAsyncProcedure(ReadGraphImpl graph, AsyncProcedure procedure, Object key) { this.procedure = procedure; this.key = key; - this.graph = ReadGraphImpl.newAsync(graph); + this.graph = graph; this.graph.asyncBarrier.inc(); } @@ -58,6 +58,10 @@ public class BlockingAsyncProcedure implements AsyncProcedure { } } + public void waitBarrier() { + graph.asyncBarrier.waitBarrier(key, graph); + } + @SuppressWarnings("unchecked") public Result get() throws DatabaseException { @@ -72,6 +76,10 @@ public class BlockingAsyncProcedure implements AsyncProcedure { } + public boolean isDone() { + return graph.asyncBarrier.get() == 0; + } + @SuppressWarnings("unchecked") public Result getResult() { return (Result)result;