Changeset 15212
- Timestamp:
- 07/12/17 16:07:08 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r15204 r15212 256 256 257 257 public void Prepare() { 258 if (startPending) return; 258 259 if (ExecutionState == ExecutionState.Started) 259 260 throw new InvalidOperationException(string.Format("Prepare not allowed in execution state \"{0}\".", ExecutionState)); … … 270 271 } 271 272 273 private bool startPending; 272 274 public void Start() { 273 275 Start(CancellationToken.None); 274 276 } 275 277 public void Start(CancellationToken cancellationToken) { 278 lock (locker) { 279 if (startPending) return; 280 startPending = true; 281 } 282 276 283 if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused)) 277 284 throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState)); … … 337 344 private bool pausePending; 338 345 public void Pause() { 346 if (startPending) return; 339 347 if (ExecutionState != ExecutionState.Started) 340 348 throw new InvalidOperationException(string.Format("Pause not allowed in execution state \"{0}\".", ExecutionState)); … … 353 361 private bool stopPending; 354 362 public void Stop() { 363 if (startPending) return; 355 364 if ((ExecutionState != ExecutionState.Started) && (ExecutionState != ExecutionState.Paused)) 356 365 throw new InvalidOperationException(string.Format("Stop not allowed in execution state \"{0}\".", … … 716 725 public event EventHandler Started; 717 726 private void OnStarted() { 727 startPending = false; 718 728 ExecutionState = ExecutionState.Started; 719 729 EventHandler handler = Started;
Note: See TracChangeset
for help on using the changeset viewer.