C#中的线程状态 [英] thread state in c#

查看:62
本文介绍了C#中的线程状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取线程的线程状态?

how to get threadstate of my thread?

推荐答案

Little googling[^] will help you.



HTH


使用其 ThreadState [^ ]属性. :)
示例:
By using its ThreadState[^] property. :)
Example:
public static void Main()
{
   Thread thread = Thread.CurrentThread;
   Console.WriteLine ("ThreadState: {0}", thread.ThreadState);
}



程序输出:线程状态:正在运行



Output of the program: ThreadState: Running


这篇关于C#中的线程状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆