Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Killing the thread  RSS feed

 
Rani Vish
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a doubt ,whether threads are process dependends or not,in the following code i want to kill all the running thread

B]public synchronized void windowClosed(WindowEvent evt) {
quit = true;
this.notifyAll();
try {

reader1.join(1000); //reader1 = new Thread(this);
pis1.close();
} catch (Exception e) {
}
System.exit(0);
}[/B]


if i dont give reader1.join(1000); this statement, has my thread automatically kill after exiting the process or it still alive in the queue
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the JVM exits, all threads are terminated. System.exit() by itself is enough.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!