示例#1
0
            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();
                }
            }
示例#2
0
 public void Finished()
 {
     FinishedEvent.Set();
     LogManager.GetCurrentClassLogger().Info("Finished Shutdown {0}", InputType);
 }
示例#3
0
 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);
 }