summaryrefslogtreecommitdiff
path: root/src/interactive/scala/tools/nsc/interactive/Global.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-08-22 12:57:27 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-08-22 12:57:27 +0200
commitd3c8a0bc81ea45177cee9a487c2c1739dbbdafff (patch)
tree8b9c997c764fcd38363ab9ad7936c49c9eec8f1d /src/interactive/scala/tools/nsc/interactive/Global.scala
parent3f72bed01d5054f77a27f69dff786463995e5450 (diff)
downloadscala-d3c8a0bc81ea45177cee9a487c2c1739dbbdafff.tar.gz
scala-d3c8a0bc81ea45177cee9a487c2c1739dbbdafff.tar.bz2
scala-d3c8a0bc81ea45177cee9a487c2c1739dbbdafff.zip
SI-6240 Synchronizes Names
Previously we didn't have all possible name creation facilities covered with locks, so some of them silently misbehaved and caused much grief: http://groups.google.com/group/scala-internals/browse_thread/thread/ec1d3e2c4bcb000a. This patch gets all the name factories under control. Rather than relying on subclasses to override mutating methods and add synchronization, they should instead override `synchronizeNames` to return true and leave the placement of the locks up to `reflect.internal.Names`. These locks are placed around sections that mutate `typeHashtable` and `termHashtable`. This is done in the reflection universe, and in the interactive compiler. The latter change will obviate an incomplete attempt do to the same in `ScalaPresentationCompiler` in the scala-ide project.
Diffstat (limited to 'src/interactive/scala/tools/nsc/interactive/Global.scala')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index 492f0f4fb4..721fbf24c7 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -140,6 +140,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
abort("originalOwner is not kept in presentation compiler runs.")
override def forInteractive = true
+ override protected def synchronizeNames = true
override def newAsSeenFromMap(pre: Type, clazz: Symbol): AsSeenFromMap =
new InteractiveAsSeenFromMap(pre, clazz)