如何获取非当前线程的堆栈跟踪? [英] How to get non-current thread's stacktrace?

查看:93
本文介绍了如何获取非当前线程的堆栈跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用System.Diagnostics.StackTrace获取堆栈跟踪,但线程必须被挂起。暂停和恢复功能已经过时,所以我希望有更好的方式存在。

It is possible to get stacktrace using System.Diagnostics.StackTrace, but thread has to be suspended. Suspend and Resume function are obsolete, so I expect that better way exists.

推荐答案

根据 C#3.0 in a Nutshell ,这是可以调用Suspend / Resume的少数几种情况之一。

According to C# 3.0 in a Nutshell, this is one of the few situations where it is okay to call Suspend/Resume.

这篇关于如何获取非当前线程的堆栈跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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