- Timestamp:
- 07/13/17 15:53:56 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs
r15065 r15232 312 312 } catch (OperationCanceledException) { 313 313 } catch (AggregateException ae) { 314 if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]); 315 else OnExceptionOccurred(ae); 314 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae); 316 315 } catch (Exception e) { 317 316 OnExceptionOccurred(e); … … 324 323 public async Task StartAsync() { await StartAsync(CancellationToken.None); } 325 324 public async Task StartAsync(CancellationToken cancellationToken) { 326 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);325 await AsyncHelper.DoAsync(Start, cancellationToken); 327 326 } 328 327 -
branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r15216 r15232 344 344 public async Task StartAsync() { await StartAsync(CancellationToken.None); } 345 345 public async Task StartAsync(CancellationToken cancellationToken) { 346 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);346 await AsyncHelper.DoAsync(Start, cancellationToken); 347 347 } 348 348 -
branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4/FixedDataAnalysisAlgorithm.cs
r15065 r15232 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Threading; 24 25 using HeuristicLab.Common; … … 77 78 } catch (OperationCanceledException) { 78 79 } catch (AggregateException ae) { 79 if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]); 80 else OnExceptionOccurred(ae); 80 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae); 81 81 } catch (Exception e) { 82 82 OnExceptionOccurred(e); -
branches/Async/HeuristicLab.Clients.OKB/3.3/RunCreation/OKBAlgorithm.cs
r15065 r15232 69 69 try { 70 70 algorithm.Problem = problem; 71 } 72 catch (ArgumentException) { 71 } catch (ArgumentException) { 73 72 algorithm.Problem = null; 74 73 } … … 263 262 public async Task StartAsync() { await StartAsync(CancellationToken.None); } 264 263 public async Task StartAsync(CancellationToken cancellationToken) { 265 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);264 await AsyncHelper.DoAsync(Start, cancellationToken); 266 265 } 267 266 public void Pause() { -
branches/Async/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
r12292 r15232 123 123 </ItemGroup> 124 124 <ItemGroup> 125 <Compile Include="AsyncHelper.cs" /> 125 126 <Compile Include="CancelEventArgs.cs" /> 126 127 <None Include="Plugin.cs.frame" /> -
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() { -
branches/Async/HeuristicLab.DebugEngine/3.3/DebugEngine.cs
r15065 r15232 181 181 } catch (OperationCanceledException) { 182 182 } catch (AggregateException ae) { 183 if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]); 184 else OnExceptionOccurred(ae); 183 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae); 185 184 } catch (Exception e) { 186 185 OnExceptionOccurred(e); -
branches/Async/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs
r15065 r15232 213 213 public virtual async Task StartAsync() { await StartAsync(CancellationToken.None); } 214 214 public virtual async Task StartAsync(CancellationToken cancellationToken) { 215 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);215 await AsyncHelper.DoAsync(Start, cancellationToken); 216 216 } 217 217 public virtual void Pause() { -
branches/Async/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
r15215 r15232 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Threading; 24 25 using HeuristicLab.Common; … … 69 70 } catch (OperationCanceledException) { 70 71 } catch (AggregateException ae) { 71 if (ae.InnerExceptions.Count == 1) OnExceptionOccurred(ae.InnerExceptions[0]); 72 else OnExceptionOccurred(ae); 72 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae); 73 73 } catch (Exception e) { 74 74 OnExceptionOccurred(e); -
branches/Async/HeuristicLab.Optimization/3.3/MetaOptimizers/BatchRun.cs
r15065 r15232 262 262 public async Task StartAsync() { await StartAsync(CancellationToken.None); } 263 263 public async Task StartAsync(CancellationToken cancellationToken) { 264 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);264 await AsyncHelper.DoAsync(Start, cancellationToken); 265 265 } 266 266 public void Pause() { -
branches/Async/HeuristicLab.Optimization/3.3/MetaOptimizers/Experiment.cs
r15065 r15232 204 204 public async Task StartAsync() { await StartAsync(CancellationToken.None); } 205 205 public async Task StartAsync(CancellationToken cancellationToken) { 206 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);206 await AsyncHelper.DoAsync(Start, cancellationToken); 207 207 } 208 208 public void Pause() { -
branches/Async/HeuristicLab.Optimization/3.3/MetaOptimizers/TimeLimitRun.cs
r15065 r15232 246 246 public async Task StartAsync() { await StartAsync(CancellationToken.None); } 247 247 public async Task StartAsync(CancellationToken cancellationToken) { 248 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken);248 await AsyncHelper.DoAsync(Start, cancellationToken); 249 249 } 250 250 public void Pause() {
Note: See TracChangeset
for help on using the changeset viewer.