Name ProcessThread

I am working on a C # application and I am facing some threading issues. I would like to know which threads work in my application.

I am using the following code:

foreach (ProcessThread s in Process.GetCurrentProcess().Threads)
{
  try
  {
    int l_iTest = 0;
    //(Thread) s.name
    //l_liTest += s.Id + ";"; <-- name of the ProcessThread ?
  }
  catch
  {
     // Some stuff
  }}

I can say, I would like to know which class or, in fact, launched my thread.

Does anyone have any ideas?

+5
source share
1 answer

Look at my answer to this question and see if you can help (that is, your thread will have access to the global repository of known threads in the application).

+1
source

All Articles