From 56791857e209f32cb6f3daef56991a39653214fc Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Mon, 5 Oct 2020 23:11:39 +0300 Subject: [PATCH] Allow ExternalReadEntry.compute to continue graph handling This is a bit hazard as ExternalReads should not fiddle with ThreadLocal graphs (e.g. SCLContext.getCurrent().get("graph") gitlab #5 Change-Id: I833113eda418fab9ae5ff4b247a7fa09469ad921 --- .../org/simantics/db/impl/query/ExternalReadEntry.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java index 4b2269d52..8d7b0597f 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java @@ -181,13 +181,15 @@ final public class ExternalReadEntry extends CacheEntryBase 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) { -- 2.47.1