C# 用ManulResetEvent 控制Thread的 Suspend、Resume
class Program { static void Main(string[] args) { Thread thread = new Thread(Work); thread.Start(); Console.ReadLine(); Pause(); Console.ReadLine(); Resume(); Console.ReadLine(); Pause(); Console.ReadLine(); Resume(); } static ManualResetEvent wait_handle = new ManualResetEvent(true); static void Pause() { wait_handle.Reset(); } static void Resume() { wait_handle.Set(); } static private void Work() { while(true) { wait_handle.WaitOne(); Console.WriteLine("running..."); } } }