summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-08-08 16:28:21 +0200
committerEugene Burmako <xeno.by@gmail.com>2013-10-18 17:58:58 +0200
commit6597eeba22891e540d88ad20ff011af5bcd99f96 (patch)
tree606e0a0561ec7df23767f3412dc105de22760dad
parent17947ed9ad42a0fbae5a16efac154e45b5f13b79 (diff)
downloadscala-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.
-rw-r--r--src/reflect/scala/reflect/runtime/Gil.scala2
-rw-r--r--src/reflect/scala/reflect/runtime/JavaUniverseForce.scala2
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