Changeset 13349 for branches/Async/HeuristicLab.Core/3.3/Executable.cs
- Timestamp:
- 11/23/15 21:18:26 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Core/3.3/Executable.cs
r12012 r13349 22 22 using System; 23 23 using System.Drawing; 24 using System.Threading; 25 using System.Threading.Tasks; 24 26 using HeuristicLab.Common; 25 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 82 84 ExecutionTime = TimeSpan.Zero; 83 85 } 84 public virtual void Start() { 86 public void Start() { 87 StartAsync().Wait(); 88 } 89 public async Task StartAsync() { 90 await StartAsync(new CancellationToken()); 91 } 92 public virtual async Task StartAsync(CancellationToken cancellationToken) { 85 93 if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused)) 86 94 throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState));
Note: See TracChangeset
for help on using the changeset viewer.