Dave,
Hi. First of all thanks for your help.
So what are you saying is, if for example, I have the following statement :
th1 = new System.Threading.Thread(new
System.Threading.ThreadStart(abc.Run));
th2= new System.Threading.Thread(new System.Threading.ThreadStart(abc.Run));
th3 = new System.Threading.Thread(new
System.Threading.ThreadStart(abc.Run));
then I have to use :
th1.Abort()
th2.Abort()
th3.Abort()
right ?
My purpose is actually have a button on the Winform and every time the
button is clicked, it will call :
th1 = new System.Threading.Thread(new
System.Threading.ThreadStart(abc.Run));
And I will then have another button on the winform that whe it is click,
user can select a particular thread to kill.
Thanks
Regards
"Dave" <kd******@wi.rr.com> wrote in message
news:u0**************@TK2MSFTNGP12.phx.gbl...
If you can keep track of the hashcode why not just keep track of the
thread object itself?
Currently there is no managed API that will enumerate the managed thread
objects, so if all you have is the hashcode there is no documented way of
converting that back to a thread object. When you create the thread you
should save the thread reference and use that later when you want to stop
the thread.
"RickDee" <ch***********@agilent.com> wrote in message
news:u0****************@TK2MSFTNGP12.phx.gbl...
Understand that when I start a thread, a number will be generated and is
able to get from GetHashCode method. But I would like to use this number
when I want to kill certain thread, anybody know how ??
Thanks
Regards