static void Main(string[] args)
{
Thread myThread = new Thread(new ThreadStart(createThread));
myThread.Start();
myThread.Suspend();
Console.WriteLine("线程已被挂起");
Console.ReadLine();
myThread.Resume();
Console.WriteLine("线程已被恢复");
Console.ReadLine();
}
static void createThread()
{
Console.WriteLine("创建线程");
Console.ReadLine();
}
线程的关键是是否有 Thread.sleep()函数,如果有,则在sleep的时间段内执行 新建的线程中的程序,如果没有,并且也没有停止线程执行的函数语句,则继续往下执行,直到程序最后再执行线程内的程序。