From bec4f9d2cbf7fe000efb849abd5d86a34a0a084a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 11 Apr 2017 08:55:17 +0200 Subject: Better documentation of sharable structures in Names, NameKinds --- compiler/src/dotty/tools/dotc/core/NameKinds.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/src/dotty/tools/dotc/core/NameKinds.scala') diff --git a/compiler/src/dotty/tools/dotc/core/NameKinds.scala b/compiler/src/dotty/tools/dotc/core/NameKinds.scala index bee39adaa..0f08e4701 100644 --- a/compiler/src/dotty/tools/dotc/core/NameKinds.scala +++ b/compiler/src/dotty/tools/dotc/core/NameKinds.scala @@ -13,6 +13,9 @@ import collection.mutable object NameKinds { + // These are sharable since all NameKinds are created eagerly at the start of the program + // before any concurrent threads are forked. for this to work, NameKinds should never + // be created lazily or in modules that start running after compilers are forked. @sharable private val simpleNameKinds = new mutable.HashMap[Int, ClassifiedNameKind] @sharable private val qualifiedNameKinds = new mutable.HashMap[Int, QualifiedNameKind] @sharable private val uniqueNameKinds = new mutable.HashMap[String, UniqueNameKind] -- cgit v1.2.3