enumerate threads

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Is there such a thing as a collection of running
threads? I have an app which creates new threads and
assigns them a name. Periodically, I need to check
the .Name of all running threads to see if a particular
thread is already running to prevent starting that same
thread again. If not a collection, how can I easily
determine all of the threads which are running?

Thanks in advance,
Mark
 
Mark said:
Is there such a thing as a collection of running
threads? I have an app which creates new threads and
assigns them a name. Periodically, I need to check
the .Name of all running threads to see if a particular
thread is already running to prevent starting that same
thread again. If not a collection, how can I easily
determine all of the threads which are running?

System.Diagnostics.Process.GetCurrentProcess.Threads
 
Thanks. You read my mind. I was considering going this
route if there was no other way.

Mark
 
Back
Top