Skip to content

Commit 0c1acec

Browse files
committed
Merge pull request scala#794 from odersky/pullreq/statistics
Fixed race condition that was caused by Statistics pushTimer.
2 parents 6f08c06 + 6ccb607 commit 0c1acec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/reflect/scala/reflect/internal/util/Statistics.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object Statistics {
4141
}
4242

4343
/** If enabled, push and start a new timer in timer stack */
44-
@inline final def pushTimer(timers: TimerStack, timer: StackableTimer): TimerSnapshot =
44+
@inline final def pushTimer(timers: TimerStack, timer: => StackableTimer): TimerSnapshot =
4545
if (_enabled && timers != null) timers.push(timer) else null
4646

4747
/** If enabled, stop and pop timer from timer stack */
@@ -190,7 +190,7 @@ quant)
190190
* on access by executing `initValue`.
191191
*/
192192
class QuantMap[K, V <% Ordered[V]](val prefix: String, val phases: Seq[String], initValue: => V)
193-
extends scala.collection.mutable.HashMap[K, V] with Quantity {
193+
extends mutable.HashMap[K, V] with mutable.SynchronizedMap[K, V] with Quantity {
194194
override def default(key: K) = {
195195
val elem = initValue
196196
this(key) = elem

0 commit comments

Comments
 (0)