aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/PerformanceMeasure.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/PerformanceMeasure.cs')
-rw-r--r--src/PerformanceMeasure.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/PerformanceMeasure.cs b/src/PerformanceMeasure.cs
index 1db29e30..3c978e8b 100644
--- a/src/PerformanceMeasure.cs
+++ b/src/PerformanceMeasure.cs
@@ -58,14 +58,16 @@ namespace Crow
computeStats ();
}
public void NotifyChanges(){
- if (cptMeasures == 0)
- return;
- NotifyValueChanged("minimum", minimum);
- NotifyValueChanged("maximum", maximum);
- NotifyValueChanged("current", current);
- // NotifyValueChanged("total", total);
- // NotifyValueChanged("cptMeasures", cptMeasures);
- NotifyValueChanged("mean", total / cptMeasures);
+ lock(this){
+ if (cptMeasures == 0)
+ return;
+ NotifyValueChanged("minimum", minimum);
+ NotifyValueChanged("maximum", maximum);
+ NotifyValueChanged("current", current);
+ // NotifyValueChanged("total", total);
+ // NotifyValueChanged("cptMeasures", cptMeasures);
+ NotifyValueChanged("mean", total / cptMeasures);
+ }
}
void computeStats(){
@@ -85,7 +87,8 @@ namespace Crow
minimum = long.MaxValue;
}
void onResetClick(object sender, MouseButtonEventArgs e){
- ResetStats();
+ lock(this)
+ ResetStats();
}
}
}