Changeset 15232 for branches/Async/HeuristicLab.Core
- Timestamp:
- 07/13/17 15:53:56 (7 years ago)
- Location:
- branches/Async/HeuristicLab.Core/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Core/3.3/Engine.cs
r15065 r15232 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using System.Threading; 25 26 using HeuristicLab.Common; … … 90 91 } catch (OperationCanceledException) { 91 92 } catch (AggregateException ae) { 92 if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]); 93 else OnExceptionOccurred(ae); 93 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae); 94 94 } catch (Exception e) { 95 95 OnExceptionOccurred(e); -
branches/Async/HeuristicLab.Core/3.3/Executable.cs
r15065 r15232 93 93 public virtual async Task StartAsync() { await StartAsync(CancellationToken.None); } 94 94 public virtual async Task StartAsync(CancellationToken cancellationToken) { 95 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);95 await AsyncHelper.DoAsync(Start, cancellationToken); 96 96 } 97 97 public virtual void Pause() {
Note: See TracChangeset
for help on using the changeset viewer.