C#线程问题 |
/// <summary> /// 开始 /// </summary> public void Start() { if (!IsSleep) { for (int i = 0; i < threadNum; i++) { updateThread.Start(); } } else { for (int i = 0; i < threadNum; i++) { if (updateThread.IsAlive) updateThread.Resume(); } } } /// <summary> /// 停止 /// </summary> public void Stop() { for (int i = 0; i < threadNum; i++) { if (updateThread.IsAlive) updateThread.Suspend(); } IsSleep = true; 警告 1 “System.Threading.Thread.Resume()”已过时:“Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202 ” 警告 2 “System.Threading.Thread.Suspend()”已过时:“Thread.Suspend has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202 ” 谁知道System.Threading.Thread.Resume,System.Threading.Thread.Suspend在VS2005中用什么方法代替啊 |
C#线程问题Threading.Thread
最新推荐文章于 2024-01-03 18:15:12 发布