diff options
author | Martin Odersky <odersky@gmail.com> | 2012-07-25 15:55:33 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-07-27 17:04:35 +0200 |
commit | 50903959efc2dcc4093f3d7c0b4b9b9def51cc04 (patch) | |
tree | 877f6d4047af08c2c60e44e4fd42889edf3625db /src | |
parent | 923d5e02298d67f84c13210cd2a20c038b8f3e46 (diff) | |
download | scala-50903959efc2dcc4093f3d7c0b4b9b9def51cc04.tar.gz scala-50903959efc2dcc4093f3d7c0b4b9b9def51cc04.tar.bz2 scala-50903959efc2dcc4093f3d7c0b4b9b9def51cc04.zip |
Disable interrupts during code instrumentation
Code instrumentation needs to see a consistent snapshot of a source file. To achieve that we disable interrupts during getInstrumented.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 2a435aa6f6..27b6cae2a6 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -1030,11 +1030,15 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "") } } - def getInstrumented(source: SourceFile, line: Int, response: Response[(String, Array[Char])]) { - respond(response) { - instrument(source, line) + def getInstrumented(source: SourceFile, line: Int, response: Response[(String, Array[Char])]) = + try { + interruptsEnabled = false + respond(response) { + instrument(source, line) + } + } finally { + interruptsEnabled = true } - } // ---------------- Helper classes --------------------------- |