Discuz!NT官方社区

首页 » Web开发 » ASP.net技术讨论 » C#线程问题
455443 - 2007-4-19 13:25:00
/// <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中用什么方法代替啊
:Q :Q
1
查看完整版本: C#线程问题