Changeset 6114 for trunk/sources/HeuristicLab.Parameters
- Timestamp:
- 05/03/11 19:25:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Parameters/3.3/Parameter.cs
r6103 r6114 92 92 protected Parameter(bool deserializing) 93 93 : base(deserializing) { 94 InitializeState(); 94 cachedActualValues = new Lazy<ThreadLocal<IItem>>(() => { return new ThreadLocal<IItem>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 95 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 95 96 } 96 97 protected Parameter(Parameter original, Cloner cloner) … … 98 99 dataType = original.dataType; 99 100 hidden = original.hidden; 100 InitializeState(); 101 cachedActualValues = new Lazy<ThreadLocal<IItem>>(() => { return new ThreadLocal<IItem>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 102 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 101 103 } 102 104 protected Parameter() … … 104 106 dataType = typeof(IItem); 105 107 hidden = false; 106 InitializeState(); 108 cachedActualValues = new Lazy<ThreadLocal<IItem>>(() => { return new ThreadLocal<IItem>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 109 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 107 110 } 108 111 protected Parameter(string name, Type dataType) … … 111 114 this.dataType = dataType; 112 115 hidden = false; 113 InitializeState(); 116 cachedActualValues = new Lazy<ThreadLocal<IItem>>(() => { return new ThreadLocal<IItem>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 117 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 114 118 } 115 119 protected Parameter(string name, string description, Type dataType) … … 118 122 this.dataType = dataType; 119 123 hidden = false; 120 InitializeState();121 }122 123 public virtual void InitializeState() {124 124 cachedActualValues = new Lazy<ThreadLocal<IItem>>(() => { return new ThreadLocal<IItem>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 125 125 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 126 126 } 127 128 public virtual void InitializeState() { } 127 129 public virtual void ClearState() { 128 cachedActualValues = n ull;129 executionContexts = n ull;130 cachedActualValues = new Lazy<ThreadLocal<IItem>>(() => { return new ThreadLocal<IItem>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 131 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 130 132 } 131 133
Note: See TracChangeset
for help on using the changeset viewer.