Interrupt python thread
nytrokiss at gmail.com
Sun Aug 24 20:48:20 CEST 2008
Group all the threads in a list and call the stop method on all of them.
On Sun, Aug 24, 2008 at 1:48 AM, BlueBird <phil at freehackers.org> wrote:
> I have a program with a master thread and several slave threads.
> Whenever an exception occurs, in the master thread or in one of the
> slave threads, I would like to interrupt all the threads and the main
> program. Threading API does not seem to provide a way to stop a
> thread, is there anyway to achieve that ?
> The closest thing I found is thread.interrupt_main() but it's far from
> perfect :
> - it only allow to interrupt the main thread
> - if the main thread is sleeping, it does not interrupt it (at least
> on windows)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list