diff options
author | schinz <schinz@epfl.ch> | 2005-05-18 08:23:48 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2005-05-18 08:23:48 +0000 |
commit | 4c8b6bac74361c20ac36b95f1f550c2ea10d2046 (patch) | |
tree | 1fdcfc49ef4cfc84b930b019c55a3de264c1905d | |
parent | 860077ec57d0ca5412c4448203e5028f3a783193 (diff) | |
download | scala-4c8b6bac74361c20ac36b95f1f550c2ea10d2046.tar.gz scala-4c8b6bac74361c20ac36b95f1f550c2ea10d2046.tar.bz2 scala-4c8b6bac74361c20ac36b95f1f550c2ea10d2046.zip |
- fixed multi-threading behaviour for the compu...
- fixed multi-threading behaviour for the computation of the ancestor
cache
-rw-r--r-- | sources/scala/runtime/types/ScalaClassType.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/scala/runtime/types/ScalaClassType.java b/sources/scala/runtime/types/ScalaClassType.java index 969e888f90..47b7b7f4d9 100644 --- a/sources/scala/runtime/types/ScalaClassType.java +++ b/sources/scala/runtime/types/ScalaClassType.java @@ -37,7 +37,7 @@ public class ScalaClassType extends ClassType { private final TypeConstructor constr; private final Type[] inst; - private Object parents; + private final Object parents; private ScalaClassType[][] ancestors = null; private final int hashCode; @@ -178,14 +178,13 @@ public class ScalaClassType extends ClassType { return ancestors; } - // TODO concurrent access? private void computeAncestors() { final int level = constr.level; final int ancestorDepth = constr.ancestorCacheDepth; final int[] ancestorCode = constr.ancestorCode; ScalaClassType[] parents = getParents(); - ancestors = new ScalaClassType[ancestorDepth][]; + ScalaClassType[][] ancestors = new ScalaClassType[ancestorDepth][]; ScalaClassType[][] initialAncestors = parents.length > 0 ? parents[0].getAncestors() : EMPTY_ANCESTORS; @@ -225,6 +224,7 @@ public class ScalaClassType extends ClassType { ancestors[l] = newRow; } } + this.ancestors = ancestors; } private static final ClassLoader loader = |