Using system; <br/> using system. threading; <br/> class crunthread <br/>{< br/> static void main () <br/>{< br/> thread. currentthread. name = "================================ main thread ==================== ==== "; <br/> crunthread. printthreadinfo (); <br/> operthreads (); <br/>}< br/> Public static void printthreadinfo () <br/>{< br/> // thread. currentthread. name = "the main thread" + RDM. next (); // name of the current thread <br/> console. writeline (thread. currentthread. name + "/tstatus:" + thread. currentthread. threadstate); <br/>}< br/> Public static void operthreads () <br/>{< br/> console. writeline ("thread start/stop/join sample"); <br/> A = new A ("Hello, andylin :)"); <br/> threadstart srttrd = new threadstart (. run); <br/> thread TRD = new thread (srttrd); <br/> TRD. start (); </P> <p> thread. sleep (10); <br/> TRD. suspend (); <br/> // TRD. abort (); <br/> // TRD. join (); <br/> console. writeline ("/n =======. run has finished ========== "); <br/> try <br/>{< br/> console. writeline ("try to restart. run... "); <br/> TRD. start (); <br/>}< br/> catch (threadstateexception e) <br/>{< br/> console. writeline (E. tostring (); <br/>}< br/> catch (system. exception e) <br/>{< br/> console. writeline (E. tostring (); <br/>}< br/> console. writeline ("============= end of operator thread ================================ "); <br/>}< br/> Class A <br/>{< br/> private string m_strval; </P> <p> Public A (string Str) <br/>{< br/> m_strval = STR; <br/>}< br/> Public void run () <br/>{< br/> thread. currentthread. name = "The a thread"; // name of the current thread <br/> while (true) <br/>{< br/> crunthread. printthreadinfo (); <br/> console. writeline ("strvalue:" + m_strval); <br/> console. writeline (". run is runing in its own thread... "); <br/>}< br/>}