Thread.Abort() method for Smart Device Application

  • Thread starter Thread starter mmuzilli
  • Start date Start date
M

mmuzilli

Hi,

I'm developing an application for Smart Device Application and I'm
creating Threads. In determinated time the thread must be stoped.

I was searching for the help about the Threads and I saw that the
Abort() method can do this, but in my case for Smart Device
Application, it doesn't work.

Why?
And how can I stop (abort) my thread?

Thanks,

Marcelo Muzilli
 
Since you *know* that the thread must be stopped, you should arrange for it
to be stopped cleanly. You might do this by having the thread wait on an
event (along with other things that it might be waiting on; the structure of
the thread determines the best way to control exiting), check a global
variable, etc. Set that event or global variable from the main code when
it's time for the thread to exit.

Paul T.
 
Back
Top