diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-01 15:59:33 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-07-06 17:46:45 +0200 |
commit | 84ad34ad7a50a7f9d39d6958a7b8840e16c37a3c (patch) | |
tree | 309525b19d9f063a384d4e2561f0b29a34986c43 /src/dotty/tools/dotc/core/Contexts.scala | |
parent | 64f65182f6e4f80b03d45923e02441dafe0755b4 (diff) | |
download | dotty-84ad34ad7a50a7f9d39d6958a7b8840e16c37a3c.tar.gz dotty-84ad34ad7a50a7f9d39d6958a7b8840e16c37a3c.tar.bz2 dotty-84ad34ad7a50a7f9d39d6958a7b8840e16c37a3c.zip |
Add @sharable annotation
Add @sharable annotation for classes and vals that are presumed
to be safely sharable between threads.
Also: Document CtxLazy.
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index c9deaab10..206ef9d8b 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -28,6 +28,7 @@ import printing._ import config.{Settings, ScalaSettings, Platform, JavaPlatform} import language.implicitConversions import DenotTransformers.DenotTransformer + object Contexts { /** A context is passed basically everywhere in dotc. @@ -473,7 +474,7 @@ object Contexts { gadt = new GADTMap(SimpleMap.Empty) } - object NoContext extends Context { + @sharable object NoContext extends Context { lazy val base = unsupported("base") override val implicits: ContextualImplicits = new ContextualImplicits(Nil, null)(this) } @@ -620,7 +621,7 @@ object Contexts { /** implicit conversion that injects all ContextBase members into a context */ implicit def toBase(ctx: Context): ContextBase = ctx.base - val theBase = new ContextBase // !!! DEBUG, so that we can use a minimal context for reporting even in code that normally cannot access a context + // @sharable val theBase = new ContextBase // !!! DEBUG, so that we can use a minimal context for reporting even in code that normally cannot access a context } /** Info that changes on each compiler run */ |