Thread Abort?

  • Thread starter Thread starter Chip
  • Start date Start date
C

Chip

I need to have an asynch thread abort itself. Something akin to a STOP. The
thread that spawned it cannot access it so it must done within the thread.

Chip
 
Best way is probably to have a field visible to the thread thats not
controlled by the async thread and have the asyn thread check if the value
signifies abort. Perhaps a value available in Context, session or
application that the async thread can periodically look at.

Regards

John Timney (MVP)


http://www.johntimney.com
 
This approach has the parent process ending the thread. The test is in the
thread itself so it needed to be a self-abort. There doesn't seem to be a
good way to do it based on what I've been able to research, so since the
easy way out is not there, I restructured the code so I could just use "exit
sub".

Thanks for the reply,

Chip
 
If you abort an asnc thread with something like thread abort I believe it
throws an unhandled exception, which can leave your objects in an ustable
state, hence my suggestion to use a controller value to terminate and exit
the thread cleanly. If you've managed to get it running to exit sub and die
cleanly then stick with it.

Regards

John Timney (MVP)
http://www.johntimney.com
 
Back
Top