aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/PerformanceMeasure.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2017-08-13 19:11:00 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2017-08-13 19:11:00 +0200
commitda33782c4ab475d0e8c1216f13ecbff2450ec546 (patch)
treefddb37a0e15ccbb543a3a567e53062630b1fc791 /src/PerformanceMeasure.cs
parenta068b75def006a4722d8026f05399bc258ab0d3f (diff)
cairo.region to handle clipping, native pointer leaking...
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();
}
}
}