如何确定哪个线程是从另一个线程创建的?

发布于 2024-09-04 10:52:13 字数 92 浏览 3 评论 0原文

.NET 中是否有任何方法可以让线程确定其“父级”,即创建它的线程?

我正在诊断黑盒第三方 API 的计时问题,并且想找出它在哪个线程上执行的自定义代码。

Is there any way in .NET for a thread to determine its 'parent', i.e. the thread that created it?

I'm diagnosing a timing issue with a black box third party API and would like to find out what custom code of mine it is executing on which thread.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

帝王念 2024-09-11 10:52:13

有点儿
如果您使用像 PostSharp 这样的工具(您必须实现一个方面),您可以确定在哪些线程上调用了 Start() 方法。

Kindof
If you use a tool like PostSharp (you have to implement an aspect), you can determine on which threads the Start() method was called.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文