How to kill main thread from sub thread in Jython

Posted by JeffGoetz on Stack Overflow See other posts from Stack Overflow or by JeffGoetz
Published on 2009-11-24T17:29:07Z Indexed on 2010/04/09 16:03 UTC
Read the original article Hit count: 407

Filed under:
|
|

I have a script that creates a thread which after 60 seconds (this thread) needs to kill the main thread. I`m not sure what command I can use to kill the main thread. I'm using Jython 2.5.1 and Thread.interrupt_main doesn't work.

Here is the code:

import threading
def exitFunct():
    #exit code here
t = threading.Timer(60.0, exitFunct)
t.start()
for i in range(1, 3000):
    print i

© Stack Overflow or respective owner

Related posts about jython

Related posts about script