需要用exitthread强行结束一个线程,线程mytimerthread建立如下:
mytimerthread:=mytimer.create(false);
请高手指教。
顶者有分。

解决方案 »

  1.   

    在线程内用
    exithread(0);在线程外用
    terminatethread(mytimerthread.handle,0);
      

  2.   


            mytimerthread.Suspend();
            mytimerthread.Terminate();
            mytimerthread.Free();
            mytimerthread:=NULL;
      

  3.   

    terminatethread无法避免内存泄漏问题,除非线程完全死掉,不推荐使用。
    至于exithread,由于在线程内用使用,使用前释放资源即可。
      

  4.   

    就用 terminatethread ,没什么选择。不过照你说的看,重新设计程序才是上策