diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-08-08 16:28:21 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-10-18 17:58:58 +0200 |
commit | 6597eeba22891e540d88ad20ff011af5bcd99f96 (patch) | |
tree | 606e0a0561ec7df23767f3412dc105de22760dad /src/reflect | |
parent | 17947ed9ad42a0fbae5a16efac154e45b5f13b79 (diff) | |
download | scala-6597eeba22891e540d88ad20ff011af5bcd99f96.tar.gz scala-6597eeba22891e540d88ad20ff011af5bcd99f96.tar.bz2 scala-6597eeba22891e540d88ad20ff011af5bcd99f96.zip |
makes all locks and tlses private and lazy
We do need lazy to be robust, because initialization sequence might
trigger synced operations in unexpected order, leading to NPE's.
Even if this is optimizable by removing some of the lazies or by
carefully reordering cake layers, there's no guarantee that all this
effort won't break after another reflection refactoring.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/runtime/Gil.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/runtime/JavaUniverseForce.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/runtime/Gil.scala b/src/reflect/scala/reflect/runtime/Gil.scala index cf6f1431d7..0edb1e5748 100644 --- a/src/reflect/scala/reflect/runtime/Gil.scala +++ b/src/reflect/scala/reflect/runtime/Gil.scala @@ -9,7 +9,7 @@ private[reflect] trait Gil { // 1) replace PackageScope locks with ConcurrentHashMap, because PackageScope materializers seem to be idempotent // 2) unlock unpickling completers by verifying that they are idempotent or moving non-idempotent parts // 3) remove the necessity in global state for isSubType - lazy val gil = new java.util.concurrent.locks.ReentrantLock + private lazy val gil = new java.util.concurrent.locks.ReentrantLock @inline final def gilSynchronized[T](body: => T): T = { if (isCompilerUniverse) body diff --git a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala index 1196d17f50..8fd58c42be 100644 --- a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala +++ b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala @@ -27,7 +27,7 @@ trait JavaUniverseForce { self: runtime.JavaUniverse => this.settings this.treeInfo - this.gil + // inaccessible: this.scala$reflect$runtime$Gil$$gil // inaccessible: this.uniqueLock // inaccessible: this._skolemizationLevel // inaccessible: this._undoLog |