From 4730ced1573705a9e07215b41f0410c0704ed29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kukie=C5=82ka?= Date: Wed, 6 Jun 2018 13:13:38 +0200 Subject: [PATCH] Await threads termination --- src/compiler/scala/tools/nsc/Global.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 43ed16b9af61..4f330bc83fcf 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -10,6 +10,7 @@ package nsc import java.io.{File, FileNotFoundException, IOException} import java.net.URL import java.nio.charset.{Charset, CharsetDecoder, IllegalCharsetNameException, UnsupportedCharsetException} +import java.util.concurrent.TimeUnit import scala.collection.{immutable, mutable} import io.{AbstractFile, Path, SourceReader} @@ -445,7 +446,9 @@ class Global(var currentSettings: Settings, reporter0: Reporter) _synchronizeNames = false ec match { - case ecxs: ExecutionContextExecutorService => ecxs.shutdown() + case ecxs: ExecutionContextExecutorService => + ecxs.shutdown() + assert(ecxs.awaitTermination(1, TimeUnit.MINUTES)) case _ => } }