Changeset 15367 for trunk/sources
- Timestamp:
- 09/18/17 12:18:47 (7 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs
r15287 r15367 312 312 } catch (OperationCanceledException) { 313 313 } catch (AggregateException ae) { 314 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);314 ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e)); 315 315 } catch (Exception e) { 316 316 OnExceptionOccurred(e); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs
r15287 r15367 222 222 } 223 223 224 private void startButton_Click(object sender, EventArgs e) {225 Content.StartAsync();224 private async void startButton_Click(object sender, EventArgs e) { 225 await Content.StartAsync(); 226 226 } 227 227 private void pauseButton_Click(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r15287 r15367 352 352 allAlgorithmsFinished = new ManualResetEventSlim(false); 353 353 354 var startedTasks = new List<Task>(clonedAlgorithms.Count); 355 354 356 //start prepared or paused cloned algorithms 355 357 foreach (IAlgorithm clonedAlgorithm in clonedAlgorithms) { … … 360 362 lock (locker) { 361 363 if (pausePending || stopPending || ExecutionState != ExecutionState.Started) break; 362 clonedAlgorithm.StartAsync(cancellationToken); 364 var task = clonedAlgorithm.StartAsync(cancellationToken); 365 startedTasks.Add(task); 363 366 } 364 367 } … … 366 369 367 370 allAlgorithmsFinished.Wait(); 371 372 Task.WaitAll(startedTasks.ToArray()); // to get exceptions not handled within the tasks 368 373 } 369 374 -
trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs
r15287 r15367 79 79 public override void Prepare() { } 80 80 81 public override void Start() {81 public override async void Start() { 82 82 Item.Prepare(initialOperation); 83 Item.StartAsync();83 await Item.StartAsync(); 84 84 } 85 85 -
trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs
r15287 r15367 96 96 } 97 97 98 public override void Start() {98 public override async void Start() { 99 99 if ((Item is Experiment && OptimizerAsExperiment.Optimizers.Count == 0) || // experiment would not fire OnStopped if it has 0 optimizers 100 100 (Item is BatchRun && OptimizerAsBatchRun.Optimizer == null)) { // batchrun would not fire OnStopped if algorithm == null 101 101 OnTaskStopped(); 102 102 } else { 103 Item.StartAsync();103 await Item.StartAsync(); 104 104 } 105 105 } -
trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBAlgorithmView.cs
r15287 r15367 324 324 if (Content != null) Content.StoreAlgorithmInEachRun = storeAlgorithmInEachRunCheckBox.Checked; 325 325 } 326 private void startButton_Click(object sender, EventArgs e) {327 Content.StartAsync();326 private async void startButton_Click(object sender, EventArgs e) { 327 await Content.StartAsync(); 328 328 } 329 329 private void pauseButton_Click(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.Common/3.3/AsyncHelper.cs
r15287 r15367 21 21 22 22 using System; 23 using System.Linq;24 23 using System.Runtime.ExceptionServices; 25 24 using System.Threading; … … 38 37 } catch (OperationCanceledException) { 39 38 } catch (AggregateException ae) { 40 var e = ae.InnerExceptions.SingleOrDefault() ?? ae; 41 ExceptionDispatchInfo.Capture(e).Throw(); 39 ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => ExceptionDispatchInfo.Capture(e).Throw()); 42 40 } 43 41 } -
trunk/sources/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
r15287 r15367 132 132 <Compile Include="Constants.cs" /> 133 133 <Compile Include="ArrayExtensions.cs" /> 134 <Compile Include="ExceptionExtensions.cs" /> 134 135 <Compile Include="Statistics\EmpiricalCumulativeDistributionFunction.cs" /> 135 136 <Compile Include="ListExtensions.cs" /> -
trunk/sources/HeuristicLab.Core/3.3/Engine.cs
r15287 r15367 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq;25 24 using System.Threading; 26 25 using HeuristicLab.Common; … … 91 90 } catch (OperationCanceledException) { 92 91 } catch (AggregateException ae) { 93 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);92 ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e)); 94 93 } catch (Exception e) { 95 94 OnExceptionOccurred(e); -
trunk/sources/HeuristicLab.DebugEngine/3.3/DebugEngine.cs
r15287 r15367 181 181 } catch (OperationCanceledException) { 182 182 } catch (AggregateException ae) { 183 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);183 ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e)); 184 184 } catch (Exception e) { 185 185 OnExceptionOccurred(e); -
trunk/sources/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs
r15287 r15367 136 136 137 137 #region Control events 138 protected virtual void startButton_Click(object sender, EventArgs e) {139 Content.StartAsync();138 protected virtual async void startButton_Click(object sender, EventArgs e) { 139 await Content.StartAsync(); 140 140 } 141 141 protected virtual void pauseButton_Click(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
r15302 r15367 84 84 } 85 85 catch (AggregateException ae) { 86 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae);86 ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e)); 87 87 } 88 88 catch (Exception e) {
Note: See TracChangeset
for help on using the changeset viewer.