diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-14 14:04:17 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-14 14:04:17 -0800 |
commit | ab77f2af52b41f70f161891be51d8737b9086d53 (patch) | |
tree | a2038583e682cd3281c78c73915bd92327bac8b2 /src | |
parent | 637d361851a725afcd871566d9ea5c0568148b57 (diff) | |
parent | 3b3bcd7b684fc432e48c20aa5317b56e87521c3b (diff) | |
download | scala-ab77f2af52b41f70f161891be51d8737b9086d53.tar.gz scala-ab77f2af52b41f70f161891be51d8737b9086d53.tar.bz2 scala-ab77f2af52b41f70f161891be51d8737b9086d53.zip |
Merge pull request #3143 from retronym/ticket/reflection-sync-restor
Revert "temporarily disables run/reflection-sync-subtypes"
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala b/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala index 298d0ffebd..1a232c8de1 100644 --- a/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala +++ b/src/reflect/scala/reflect/runtime/SynchronizedSymbols.scala @@ -32,8 +32,15 @@ private[reflect] trait SynchronizedSymbols extends internal.Symbols { self: Symb trait SynchronizedSymbol extends Symbol { def gilSynchronizedIfNotInited[T](body: => T): T = { - if (isFullyInitialized) body - else gilSynchronized { body } + // TODO JZ desired, but prone to race conditions. We need the runtime reflection based + // type completers to establish a memory barrier upon initialization. Maybe a volatile + // write? We need to consult with the experts here. Until them, lock pessimistically. + // + // `run/reflection-sync-subtypes.scala` fails about 1/50 times otherwise. + // + // if (isFullyInitialized) body + // else gilSynchronized { body } + gilSynchronized { body } } override def validTo = gilSynchronizedIfNotInited { super.validTo } |