Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9504


Ignore:
Timestamp:
05/22/13 10:21:42 (12 years ago)
Author:
mkommend
Message:

#2052: Added lock object to synchronize access to the results collection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r9493 r9504  
    651651
    652652    private readonly object locker = new object();
     653    private readonly object resultLocker = new object();
    653654    private void ClonedAlgorithm_Started(object sender, EventArgs e) {
    654655      IAlgorithm algorithm = sender as IAlgorithm;
    655       if (algorithm != null && !results.ContainsKey(algorithm.Name))
    656         results.Add(new Result(algorithm.Name, "Contains results for the specific fold.", algorithm.Results));
    657 
     656      lock (resultLocker) {
     657        if (algorithm != null && !results.ContainsKey(algorithm.Name))
     658          results.Add(new Result(algorithm.Name, "Contains results for the specific fold.", algorithm.Results));
     659      }
    658660    }
    659661
Note: See TracChangeset for help on using the changeset viewer.