summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-02-04 11:08:21 +0100
committerEugene Burmako <xeno.by@gmail.com>2013-10-18 17:48:52 +0200
commit000c18a8fac60065747652368dadcd7850532f3f (patch)
tree3caaca57f3125eaa9eebebabbb3a3cfefc6331e7 /src/reflect
parentefdcb3c837c8fac0c90be7f794a379c4b808147b (diff)
downloadscala-000c18a8fac60065747652368dadcd7850532f3f.tar.gz
scala-000c18a8fac60065747652368dadcd7850532f3f.tar.bz2
scala-000c18a8fac60065747652368dadcd7850532f3f.zip
synchronizes pendingVolatiles
Called from isVolatile, which is called from isStable, which is a part of the public reflection API.
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala2
-rw-r--r--src/reflect/scala/reflect/internal/Types.scala4
-rw-r--r--src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala2
3 files changed, 3 insertions, 5 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index fd627b8fd3..9b44c815d2 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -806,7 +806,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
*
* Stability and volatility are checked separately to allow volatile paths in patterns that amount to equality checks. SI-6815
*/
- final def isStable = isTerm && !isMutable && !(hasFlag(BYNAMEPARAM)) && (!isMethod || hasStableFlag)
+ def isStable = isTerm && !isMutable && !(hasFlag(BYNAMEPARAM)) && (!isMethod || hasStableFlag)
final def hasVolatileType = tpe.isVolatile && !hasAnnotation(uncheckedStableClass)
/** Does this symbol denote the primary constructor of its enclosing class? */
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala
index 9344212294..63ea9d2f31 100644
--- a/src/reflect/scala/reflect/internal/Types.scala
+++ b/src/reflect/scala/reflect/internal/Types.scala
@@ -1974,10 +1974,6 @@ trait Types
def apply(value: Constant) = unique(new UniqueConstantType(value))
}
- /* Syncnote: The `volatile` var and `pendingVolatiles` mutable set need not be protected
- * with synchronized, because they are accessed only from isVolatile, which is called only from
- * Typer.
- */
private var volatileRecursions: Int = 0
private val pendingVolatiles = new mutable.HashSet[Symbol]
diff --git a/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala b/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala
index 7f08e8fbe2..5e1bfef234 100644
--- a/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala
+++ b/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala
@@ -62,6 +62,8 @@ private[reflect] trait SynchronizedSymbols extends internal.Symbols { self: Symb
}
}
+ override def isStable: Boolean = gilSynchronized { super.isStable }
+
// ------ creators -------------------------------------------------------------------
override protected def createAbstractTypeSymbol(name: TypeName, pos: Position, newFlags: Long): AbstractTypeSymbol =