]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java
Allow ExternalReadEntry.compute to continue graph handling
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / ExternalReadEntry.java
index 4b2269d5281dc05b94adec0e9568ee18c6006e3e..8d7b0597fde5e3563649befe516e26f61a00484c 100644 (file)
@@ -181,13 +181,15 @@ final public class ExternalReadEntry<T> extends CacheEntryBase<AsyncProcedure<T>
                try {
                        
                        ReadGraphImpl queryGraph = graph.withParent(this, null, true);
+                       queryGraph.asyncBarrier.inc();
 
-                       if(!registered) {
-                               id.register(graph, this);
+                       if (!registered) {
+                               id.register(queryGraph, this);
                                registered = true;
                        }
-                       
-                       queryGraph.asyncBarrier.waitBarrier(id, graph);
+
+                       queryGraph.asyncBarrier.dec();
+                       queryGraph.asyncBarrier.waitBarrier(id, queryGraph);
 
                } catch (Throwable t) {