Beispiel #1
0
 public virtual void Stop()
 {
     if (!m_bRun)
     {
         return;
     }
     m_bRun = false;
     if (m_thread != null)
     {
         m_thread.Abort();
         m_thread.Join();
     }
     m_thread = null;
     ThreadRuntime.ThreadStoppped(this);
 }
Beispiel #2
0
 public virtual bool Start(int nSleep)
 {
     m_nSleep = nSleep;
     if (!m_bRun)
     {
         m_bRun   = true;
         m_thread = new Thread(this.WorkThread);
         m_thread.IsBackground = true;
         m_thread.Name         = m_ThreadName;
         m_thread.Priority     = m_Priority;
         m_thread.Start();
         ThreadRuntime.ThreadStarted(this);
     }
     return(m_bRun);
 }