G
Guest
The constructor new System.Diagnostics.StackTrace(System.Threading.Thread
targetThread, bool getSourceInformation) *requires* that the target thread be
suspended.
But System.Threading.Thread.Suspend (and .Resume) are currently labelled
Obsolete and the documentation states that they are scheduled to be removed
in a future version.
What is planned to avoid the upcoming uselessness of this StackTrace ctor?
Our suggestion would be another signature for the StackTrace constructor
which takes a boolean flag indicating that you want the stack trace even if
the thread is not suspended (implemented however they want, maybe by
suspending the thread internally). All you are assured is that the returned
stack trace was a true stack trace for the target thread *sometime* during
the StackTrace ctor call.
We are using this feature to perform statistical execution profiling of a
thread from within the application itself (using another thread of course).
targetThread, bool getSourceInformation) *requires* that the target thread be
suspended.
But System.Threading.Thread.Suspend (and .Resume) are currently labelled
Obsolete and the documentation states that they are scheduled to be removed
in a future version.
What is planned to avoid the upcoming uselessness of this StackTrace ctor?
Our suggestion would be another signature for the StackTrace constructor
which takes a boolean flag indicating that you want the stack trace even if
the thread is not suspended (implemented however they want, maybe by
suspending the thread internally). All you are assured is that the returned
stack trace was a true stack trace for the target thread *sometime* during
the StackTrace ctor call.
We are using this feature to perform statistical execution profiling of a
thread from within the application itself (using another thread of course).