Skip to content

Commit 72d5e0e

Browse files
committed
Fix compilation under -Ycheck-reentrant
1 parent c81e5e7 commit 72d5e0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: compiler/src/dotty/tools/dotc/profile/FileUtils.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import java.util.concurrent.atomic.AtomicBoolean
2727
import scala.concurrent.duration.Duration
2828
import scala.concurrent.{Await, Promise}
2929
import scala.util.{Failure, Success}
30+
import scala.annotation.internal.sharable
3031

3132
object FileUtils {
3233
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 {
7273
}
7374

7475
private object AsyncBufferedWriter {
75-
private val Close = CharBuffer.allocate(0)
76-
private val Flush = CharBuffer.allocate(0)
76+
@sharable private val Close = CharBuffer.allocate(0)
77+
@sharable private val Flush = CharBuffer.allocate(0)
7778
}
7879
private class AsyncBufferedWriter(val underlying: Writer, bufferSize : Int = 4096) extends LineWriter {
7980
private var current: CharBuffer = allocate

0 commit comments

Comments
 (0)