From 72d5e0e7ee5fab6202a5419aeb0a6586a3405323 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 8 May 2024 00:09:08 +0200 Subject: [PATCH] Fix compilation under -Ycheck-reentrant --- compiler/src/dotty/tools/dotc/profile/FileUtils.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/profile/FileUtils.scala b/compiler/src/dotty/tools/dotc/profile/FileUtils.scala index 97c2417d236b..4aec428c05bf 100644 --- a/compiler/src/dotty/tools/dotc/profile/FileUtils.scala +++ b/compiler/src/dotty/tools/dotc/profile/FileUtils.scala @@ -27,6 +27,7 @@ import java.util.concurrent.atomic.AtomicBoolean import scala.concurrent.duration.Duration import scala.concurrent.{Await, Promise} import scala.util.{Failure, Success} +import scala.annotation.internal.sharable object FileUtils { def newAsyncBufferedWriter(path: Path, charset: Charset = StandardCharsets.UTF_8.nn, options: Array[OpenOption] = NO_OPTIONS, threadsafe: Boolean = false): LineWriter = { @@ -72,8 +73,8 @@ object FileUtils { } private object AsyncBufferedWriter { - private val Close = CharBuffer.allocate(0) - private val Flush = CharBuffer.allocate(0) + @sharable private val Close = CharBuffer.allocate(0) + @sharable private val Flush = CharBuffer.allocate(0) } private class AsyncBufferedWriter(val underlying: Writer, bufferSize : Int = 4096) extends LineWriter { private var current: CharBuffer = allocate