diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-08-22 12:57:27 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-08-22 12:57:27 +0200 |
commit | d3c8a0bc81ea45177cee9a487c2c1739dbbdafff (patch) | |
tree | 8b9c997c764fcd38363ab9ad7936c49c9eec8f1d /src/interactive | |
parent | 3f72bed01d5054f77a27f69dff786463995e5450 (diff) | |
download | scala-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')
-rw-r--r-- | src/interactive/scala/tools/nsc/interactive/Global.scala | 1 |
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) |