Changeset 5208 for trunk/sources/HeuristicLab.Operators
- Timestamp:
- 01/04/11 06:17:50 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators/3.3/IntCounter.cs
r4722 r5208 33 33 [StorableClass] 34 34 public sealed class IntCounter : SingleSuccessorOperator { 35 private object locker = new object(); 36 35 37 public LookupParameter<IntValue> ValueParameter { 36 38 get { return (LookupParameter<IntValue>)Parameters["Value"]; } … … 60 62 61 63 public override IOperation Apply() { 62 if (ValueParameter.ActualValue == null) ValueParameter.ActualValue = new IntValue(); 63 ValueParameter.ActualValue.Value += IncrementParameter.ActualValue.Value; 64 lock (locker) { 65 if (ValueParameter.ActualValue == null) ValueParameter.ActualValue = new IntValue(); 66 ValueParameter.ActualValue.Value += IncrementParameter.ActualValue.Value; 67 } 64 68 return base.Apply(); 65 69 }
Note: See TracChangeset
for help on using the changeset viewer.