Changeset 15065 for branches/Async/HeuristicLab.Core/3.3/Executable.cs
- Timestamp:
- 06/26/17 09:45:36 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Core/3.3/Executable.cs
r13354 r15065 84 84 ExecutionTime = TimeSpan.Zero; 85 85 } 86 public v oid Start() {87 Start Async().Wait();86 public virtual void Start() { 87 Start(CancellationToken.None); 88 88 } 89 public async Task StartAsync() { 90 await StartAsync(CancellationToken.None); 91 } 92 public virtual async Task StartAsync(CancellationToken cancellationToken) { 89 public virtual void Start(CancellationToken cancellationToken) { 93 90 if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused)) 94 91 throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState)); 92 } 93 public virtual async Task StartAsync() { await StartAsync(CancellationToken.None); } 94 public virtual async Task StartAsync(CancellationToken cancellationToken) { 95 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken); 95 96 } 96 97 public virtual void Pause() {
Note: See TracChangeset
for help on using the changeset viewer.