public override void StopAllThread() { base.StopAllThread(); //先把队列清掉 mSendMsgQueue.Dispose(); if (mSendThread != null) { mSendWork = false; mSendSemaphore.ProduceResrouce(); // 唤醒线程 mSendThread.Join(); // 等待子线程退出 mSendThread = null; } }
public override void StopAllThread() { //UnityEngine.Debug.LogError("调用了 HjTcpNetwork StopAllThread"); if (mSendThread != null) { mSendWork = false; mSendSemaphore.ProduceResrouce(); // 唤醒线程 mSendThread.Join(); // 等待子线程退出 mSendThread = null; } //清除发消息队列清掉 mSendMsgQueue.Dispose(); //清除收消息队列 base.StopAllThread(); }