使用ManagedThreadId Getiing线程信息! [英] Getiing Thread info using ManagedThreadId!
本文介绍了使用ManagedThreadId Getiing线程信息!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好专家
我的项目中有一些线程,他们的ManagedThreadId已被保存。
我想知道是否有可能得到像IsAlive这样的属性或它们被中止的时间?
Hello Experts
I have some threads in my project which their ManagedThreadId have been saved.
I wanna know that is it possible to get their properties such as IsAlive or what time they have been aborted?
推荐答案
正如这里建议的那样:从ThreadID获取线程 [ ^ ]您可以迭代当前进程的所有线程,直到与 ManagedThreadId
匹配为止找到。然后使用线程引用,您可以获得所有必需的信息。
As suggested here: "Obtaining a Thread from ThreadID"[^] you might iterate on all the threads of the current process until a match with your ManagedThreadId
is found. Then having the thread reference, you can obtain all the required info.
这篇关于使用ManagedThreadId Getiing线程信息!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文