enumerate threads

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
 
A

Armin Zingler

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
 
M

Mark

Thanks. You read my mind. I was considering going this
route if there was no other way.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top