Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stopping a thread

 
kesava chaitanya
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

1)in the API stop method was deprecated ;How will u stop a thread?.;
2)wat is deadlock?
anybody write a simple exmple for stopping a thread
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the recommended way to make a stoppable thread:

"Deadlock" is when one thread has locked object 1, and is waiting to lock object 2, while a second thread has locked object 2, and is waiting to lock object 1. The two threads will wait forever; this is called deadlock.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic