Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/11 19:25:13 (13 years ago)
Author:
swagner
Message:

Code formatting and minor changes (#1424)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/Operator.cs

    r6103 r6114  
    7474    protected Operator(bool deserializing)
    7575      : base(deserializing) {
    76       InitializeState();
     76      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    7777    }
    7878    protected Operator(Operator original, Cloner cloner)
    7979      : base(original, cloner) {
    80       InitializeState();
     80      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    8181      this.breakpoint = original.breakpoint;
    8282    }
    8383    protected Operator()
    8484      : base() {
    85       InitializeState();
     85      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    8686      breakpoint = false;
    8787    }
    8888    protected Operator(string name)
    8989      : base(name) {
    90       InitializeState();
     90      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    9191      breakpoint = false;
    9292    }
    9393    protected Operator(string name, ParameterCollection parameters)
    9494      : base(name, parameters) {
    95       InitializeState();
     95      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    9696      breakpoint = false;
    9797    }
    9898    protected Operator(string name, string description)
    9999      : base(name, description) {
    100       InitializeState();
     100      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    101101      breakpoint = false;
    102102    }
    103103    protected Operator(string name, string description, ParameterCollection parameters)
    104104      : base(name, description, parameters) {
    105       InitializeState();
     105      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    106106      breakpoint = false;
    107107    }
    108108
    109     public virtual void InitializeState() {
     109    public virtual void InitializeState() { }
     110    public virtual void ClearState() {
    110111      executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);
    111     }
    112     public virtual void ClearState() {
    113       executionContexts = null;
    114112    }
    115113
     
    123121        OnExecuted();
    124122        return next;
    125       } finally {
     123      }
     124      finally {
    126125        foreach (IParameter param in Parameters)
    127126          param.ExecutionContext = null;
Note: See TracChangeset for help on using the changeset viewer.