本文介绍了Thread.sleep代码...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 目前我的线程正在旋转并且正在做一个 Thread.Sleep(someTime)。 我想把它改成Thread.Sleep(Timeout.Infinite);然后 当我在一个集合中有实际数据要在这个线程中处理时,我是_ 要做一个_thread.Interrupt();这会是一个更好的方法吗? 旋转线程?Hi,Currently I have a thread thats spinning and doing aThread.Sleep(someTime).I was thinking of changing this to Thread.Sleep(Timeout.Infinite); thenwhen I have actual data in a collection to process in this thread, I wasgoing to do a _thread.Interrupt(); Would this be a better approach tospinning a thread on ?推荐答案 更好的方法仍然是使用Monitor.Wait和Monitor.Pulse。 /> - Jon Skeet - < sk *** @ pobox.com> http://www.pobox.com/~skeet 如果回复该群组,请不要给我发邮件A better approach still would be to use Monitor.Wait and Monitor.Pulse.--Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeetIf replying to the group, please do not mail me too 更好的方法仍然是使用Monitor.Wait和Monitor.Pulse。 - Jon Skeet - < sk *** @ pobox.com> http://www.pobox.com/~skeet 如果回复该组,请不要给我发邮件 A better approach still would be to use Monitor.Wait and Monitor.Pulse. -- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too 更好的方法仍然是使用Monitor.Wait和Monitor.Pulse。 - Jon Skeet - < sk *** @ pobox.com> http://www.pobox.com/~skeet 如果回复该组,请不要给我发邮件 A better approach still would be to use Monitor.Wait and Monitor.Pulse. -- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too 这篇关于Thread.sleep代码...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!