Changeset 6114 for trunk/sources/HeuristicLab.Operators
- Timestamp:
- 05/03/11 19:25:13 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators/3.3/Operator.cs
r6103 r6114 74 74 protected Operator(bool deserializing) 75 75 : base(deserializing) { 76 InitializeState();76 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 77 77 } 78 78 protected Operator(Operator original, Cloner cloner) 79 79 : base(original, cloner) { 80 InitializeState();80 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 81 81 this.breakpoint = original.breakpoint; 82 82 } 83 83 protected Operator() 84 84 : base() { 85 InitializeState();85 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 86 86 breakpoint = false; 87 87 } 88 88 protected Operator(string name) 89 89 : base(name) { 90 InitializeState();90 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 91 91 breakpoint = false; 92 92 } 93 93 protected Operator(string name, ParameterCollection parameters) 94 94 : base(name, parameters) { 95 InitializeState();95 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 96 96 breakpoint = false; 97 97 } 98 98 protected Operator(string name, string description) 99 99 : base(name, description) { 100 InitializeState();100 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 101 101 breakpoint = false; 102 102 } 103 103 protected Operator(string name, string description, ParameterCollection parameters) 104 104 : base(name, description, parameters) { 105 InitializeState();105 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 106 106 breakpoint = false; 107 107 } 108 108 109 public virtual void InitializeState() { 109 public virtual void InitializeState() { } 110 public virtual void ClearState() { 110 111 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 111 }112 public virtual void ClearState() {113 executionContexts = null;114 112 } 115 113 … … 123 121 OnExecuted(); 124 122 return next; 125 } finally { 123 } 124 finally { 126 125 foreach (IParameter param in Parameters) 127 126 param.ExecutionContext = null;
Note: See TracChangeset
for help on using the changeset viewer.