private void RemoveFromProgress(waitableasync value) { _lockStepInProgress.EnterWriteLock(); try { StepInProgress.Remove(value); } finally { _lockStepInProgress.ExitWriteLock(); } }
protected override void AddInProgress(Step step) { var a = new async(() => FindSolution(step), _threadPool); _lockStepInProgress.EnterWriteLock(); try { StepInProgress.Add(a); } finally { _lockStepInProgress.ExitWriteLock(); } }
private void ClearFinished() { _lockStepInProgress.EnterWriteLock(); try { foreach (var value in StepInProgress.Where(e => e.ExecutionCompleted).ToArray()) { StepInProgress.Remove(value); } } finally { _lockStepInProgress.ExitWriteLock(); } }
protected override void AddInProgress(Step step) { StepInProgress.Add(step); FindSolution(step); StepInProgress.Remove(step); }