summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-06-28 19:05:21 +0200
committerMartin Odersky <odersky@gmail.com>2012-06-28 19:05:21 +0200
commit6ccb607dd5c9481f859394f3c8c815b5ffa6ed73 (patch)
tree550b65b991fb47e5f4e58bc06b61d7c7e56e4808 /src/reflect
parent1d67fe63b8c1e5537cccc60734cfbf3bc64d10ab (diff)
downloadscala-6ccb607dd5c9481f859394f3c8c815b5ffa6ed73.tar.gz
scala-6ccb607dd5c9481f859394f3c8c815b5ffa6ed73.tar.bz2
scala-6ccb607dd5c9481f859394f3c8c815b5ffa6ed73.zip
Fixed race condition that was caused by Statistics pushTimer.
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/util/Statistics.scala4
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