Exemplo n.º 1
0
        private void EventAttackStart()
        {
            while (true)
            {
                WaitQueue();

                // 工作代码
WorkStart:
                try
                {
                    Process1();
                }
                catch (ThreadAbortException) { }
                catch (Exceptions.ReactivateThreadException)
                {
                    // 在工作模式内重新开始线程
                    Delay(500);
                    goto WorkStart;
                    throw;
                }
                catch (Exceptions.TimeOutException)
                {
                    // 超时
                    OvertimeProcess();
                }
                catch (Exceptions.DataErrorException e)
                {
                    // 数据异常
                    FunctionExceptionLog.Write($"数据异常,出击线程已关闭:", e);
                    this.StopThread();
                }
                IsWorking = false;
            }
            this.StopThread();
        }
Exemplo n.º 2
0
 protected override void Entrance()
 {
     try
     {
         EventAttackStart();
     }
     catch (ThreadAbortException) { }
     catch (Exception e)
     {
         FunctionExceptionLog.Write($"发生致命错误,出击线程已关闭:", e);
         this.StopThread();
     }
 }