你能在.net紧凑框架中访问线程状态吗?

本文关键字:线程 访问 状态 框架 net | 更新日期: 2023-09-27 18:13:45

是否有可能在紧凑框架3.5中获得线程状态信息?

Thread th=new Thread(new ThreadStart(DoIT));
th.Start();
Thred.sleep(1000);
th.??? // is thread running, suspended, etc.?
void DoIT(){
  //do stuff in here and exit after some second
}

你能在.net紧凑框架中访问线程状态吗?

MSDN论坛官方不支持

建议的解决方法:使用Join(0)并检查返回标志。真正 -终止,——仍然运行