]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/LazyModule.java
Race condition fix caused deadlock, allow parallel recomputation
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / module / LazyModule.java
index 61d2c29288992f63ddb6ab2209a9336f86e918d8..41aff8d3122813cf153cdd43e36e5dea197ccd36 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.scl.compiler.module;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.simantics.scl.compiler.constants.Constant;
 import org.simantics.scl.compiler.elaboration.chr.CHRRuleset;
@@ -25,10 +26,10 @@ import gnu.trove.map.hash.THashMap;
 
 public abstract class LazyModule implements Module {
 
-    String moduleName;
-    private THashMap<String, SCLValue> values = new THashMap<String, SCLValue>();
-    private THashMap<String, SCLRelation> relations = new THashMap<String, SCLRelation>();
-    private THashMap<String, SCLEntityType> entityTypes = new THashMap<String, SCLEntityType>();
+    private final String moduleName;
+    private final ConcurrentHashMap<String, SCLValue> values = new ConcurrentHashMap<String, SCLValue>();
+    private final ConcurrentHashMap<String, SCLRelation> relations = new ConcurrentHashMap<String, SCLRelation>();
+    private final ConcurrentHashMap<String, SCLEntityType> entityTypes = new ConcurrentHashMap<String, SCLEntityType>();
     
     protected abstract SCLValue createValue(String name);
     
@@ -152,4 +153,9 @@ public abstract class LazyModule implements Module {
     public CHRRuleset getRuleset(String name) {
         return null;
     }
+    
+    @Override
+    public String getDeprecation() {
+        return null;
+    }
 }