Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8994


Ignore:
Timestamp:
12/04/12 14:30:58 (12 years ago)
Author:
ascheibe
Message:

#1950 added locking for assigning runs to the run collection view

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r8962 r8994  
    4646    private HiveResourceSelectorDialog hiveResourceSelectorDialog;
    4747    private bool SuppressEvents { get; set; }
     48    private object runCollectionViewLocker = new object();
    4849
    4950    public new RefreshableJob Content {
     
    132133          logView.Content = null;
    133134          refreshAutomaticallyCheckBox.Checked = false;
    134           runCollectionViewHost.Content = null;
     135          lock (runCollectionViewLocker) {
     136            runCollectionViewHost.Content = null;
     137          }
    135138        } else {
    136139          nameTextBox.Text = Content.Job.Name;
     
    140143          refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically;
    141144          logView.Content = Content.Log;
    142           runCollectionViewHost.Content = GetAllRunsFromJob(Content);
     145          lock (runCollectionViewLocker) {
     146            runCollectionViewHost.Content = GetAllRunsFromJob(Content);
     147          }
    143148        }
    144149      }
     
    192197    #region Content Events
    193198    void Content_TaskReceived(object sender, EventArgs e) {
    194       runCollectionViewHost.Content = GetAllRunsFromJob(Content);
     199      lock (runCollectionViewLocker) {
     200        runCollectionViewHost.Content = GetAllRunsFromJob(Content);
     201      }
    195202    }
    196203
     
    288295
    289296    void Content_Loaded(object sender, EventArgs e) {
    290       runCollectionViewHost.Content = GetAllRunsFromJob(Content);
     297      lock (runCollectionViewLocker) {
     298        runCollectionViewHost.Content = GetAllRunsFromJob(Content);
     299      }
    291300    }
    292301
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs

    r8993 r8994  
    302302              });
    303303            }
    304           } else
    305             throw new Exception("This should not happen");
     304          }
    306305        }
    307306        GC.Collect(); // force GC, because .NET is too lazy here (deserialization takes a lot of memory)
Note: See TracChangeset for help on using the changeset viewer.