示例#1
0
 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());
     }
 }
示例#2
0
 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);
     }
 }