public void run() { bool loop_out = false; //增加循环跳出标示位 while (isT) { switch (status) { case 0://暂停 try { Thread.Sleep(1000 * 1); } catch (Exception e) { LogUtil.Error("Error in pause status.", e); } break; case 1://开始 try { process(); // loop_out = true; } catch (EisException e) { LogUtil.Error("Error in Service Provider:\n", e); handler.handleException(e); resetConnectionPoolManager(); } break; case 2://停止 StringBuilder sb = new StringBuilder().Append("Provider[").Append(this).Append("] is stopped."); LogUtil.Info(this, sb.ToString()); sb = null; loop_out = true; break; default: break; } if (loop_out) { break; } } }