private void DoWork() { try { //iterate action while previous action in chain is not completed do { _action(_param1, _param2); } while (!PreviousTaskIsCompleted()); _action(_param1, _param2); } catch (Exception exception) { exception.Source = $"{Name}: {exception.Source}. Thread: {Thread.CurrentThread.Name}"; this.Exception = exception; } finally { FinishedFlag = true; if (Exception != null) { //signal error to for other threads in chain try { SignalError(); } catch { } //ignore possible error in callback; } //set completed flag FinishedEvent.Set(); } }
public void Finished() { FinishedEvent.Set(); LogManager.GetCurrentClassLogger().Info("Finished Shutdown {0}", InputType); }
public void Finished() { LogManager.GetCurrentClassLogger().Info("{0}: Signalling Event Shutdown {1}", Thread.CurrentThread.ManagedThreadId, InputType); FinishedEvent.Set(); LogManager.GetCurrentClassLogger().Info("{0}: Finished signalling Shutdown {1}", Thread.CurrentThread.ManagedThreadId, InputType); }