diff options
author | Martin Odersky <odersky@gmail.com> | 2012-06-28 19:05:21 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-06-28 19:05:21 +0200 |
commit | 6ccb607dd5c9481f859394f3c8c815b5ffa6ed73 (patch) | |
tree | 550b65b991fb47e5f4e58bc06b61d7c7e56e4808 | |
parent | 1d67fe63b8c1e5537cccc60734cfbf3bc64d10ab (diff) | |
download | scala-6ccb607dd5c9481f859394f3c8c815b5ffa6ed73.tar.gz scala-6ccb607dd5c9481f859394f3c8c815b5ffa6ed73.tar.bz2 scala-6ccb607dd5c9481f859394f3c8c815b5ffa6ed73.zip |
Fixed race condition that was caused by Statistics pushTimer.
-rw-r--r-- | src/reflect/scala/reflect/internal/util/Statistics.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/util/Statistics.scala b/src/reflect/scala/reflect/internal/util/Statistics.scala index f69530c40d..3a31c2858b 100644 --- a/src/reflect/scala/reflect/internal/util/Statistics.scala +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala @@ -41,7 +41,7 @@ object Statistics { } /** If enabled, push and start a new timer in timer stack */ - @inline final def pushTimer(timers: TimerStack, timer: StackableTimer): TimerSnapshot = + @inline final def pushTimer(timers: TimerStack, timer: => StackableTimer): TimerSnapshot = if (_enabled && timers != null) timers.push(timer) else null /** If enabled, stop and pop timer from timer stack */ @@ -190,7 +190,7 @@ quant) * on access by executing `initValue`. */ class QuantMap[K, V <% Ordered[V]](val prefix: String, val phases: Seq[String], initValue: => V) - extends scala.collection.mutable.HashMap[K, V] with Quantity { + extends mutable.HashMap[K, V] with mutable.SynchronizedMap[K, V] with Quantity { override def default(key: K) = { val elem = initValue this(key) = elem |