vb.net 如何在vb.net中使用线程名称检查线程是否处于活动状态

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17016612/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 13:53:49  来源:igfitidea点击:

How to check whether thread is alive by using thread name in vb.net

vb.netmultithreading

提问by Chow.Net

I have a thread name .By using that thread name how i may need to find whether the thread is alive or not. In Thread Name I have a combination of app_num and Id which helps to refer me when new thread starts.So I need to give condition that if thread is already alive for same App_num and Queue_Id then it skips starting another new thread as it already exists

我有一个线程名称。通过使用该线程名称,我可能需要如何查找线程是否处于活动状态。在线程名称中,我有 app_num 和 Id 的组合,这有助于在新线程启动时引用我。

Thanks in advance

提前致谢

回答by NeverHopeless

From your provided details I am expecting that you are in need of Thread.IsAliveproperty.

根据您提供的详细信息,我希望您需要Thread.IsAlive属性。

Don't forget to look at the thisthread, it will help you to get threads from a process (See badbod99's solution)

不要忘记查看线程,它将帮助您从进程中获取线程(参见 badbod99 的解决方案)

Hope it helps!

希望能帮助到你!