diff options
author | liu fengyun <liu@fengy.me> | 2017-04-13 15:03:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 15:03:13 +0200 |
commit | fb4adc3c9c55476d2fe0deed22cff54e8e945406 (patch) | |
tree | b7577f66688ed793a73ff543042a140e62cbe80d /compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala | |
parent | cf37737f56db7bc2f7429f78328dc5eea1716356 (diff) | |
parent | de6461ab17562dbb46a1ff094590e051d03cb54c (diff) | |
download | dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.tar.gz dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.tar.bz2 dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.zip |
Merge branch 'master' into fix-2253
Diffstat (limited to 'compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala')
-rw-r--r-- | compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala b/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala index ad068e9ef..610466224 100644 --- a/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala +++ b/compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala @@ -3,6 +3,7 @@ package tools package vulpix import java.io.{ File => JFile, InputStreamReader, BufferedReader, PrintStream } +import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.TimeoutException import scala.concurrent.duration.Duration @@ -84,11 +85,11 @@ trait RunnerOrchestration { } /** Did add hook to kill the child VMs? */ - private[this] var didAddCleanupCallback = false + private[this] val didAddCleanupCallback = new AtomicBoolean(false) /** Blocks less than `maxDuration` while running `Test.main` from `dir` */ def runMain(classPath: String)(implicit summaryReport: SummaryReporting): Status = { - if (!didAddCleanupCallback) { + if (didAddCleanupCallback.compareAndSet(false, true)) { // If for some reason the test runner (i.e. sbt) doesn't kill the VM, we // need to clean up ourselves. summaryReport.addCleanup(killAll) |