private void RunKillThread() { try { Thread thr = m_conn.m_thread; Thread.Sleep(2500); try { if (thr != null && thr.IsAlive) { ThreadRegister.MarkThreadDefinitivelyAborted(thr); thr.Abort(); } } catch { // neresime zamykani, tak to tady asi muze spadnout, ale nic se nedeje... } CallClosed(); } catch (Exception e) { Logging.Error("Error in RunKillThread:" + e.ToString()); } }
public void EndClose(IAsyncResult async) { if (m_thread != null) { m_thread.Join(100); if (m_thread.IsAlive) { ThreadRegister.MarkThreadDefinitivelyAborted(m_thread); m_thread.Abort(); } } m_thread = null; m_breakStarted = false; m_queue = null; if (async is KillObject) { ((KillObject)async).EndInvoke(); } else { EndInvoke(async); } }