scala/scala — pull request #2864 by retronym (2013-08-22 10:53:21+00:00)
Title: 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.

Review by @xeno-by @gkossakowski