File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes stopping a thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "stopping a thread" Watch "stopping a thread" New topic

stopping a thread

kesava chaitanya
Ranch Hand

Joined: Aug 15, 2001
Posts: 140

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

Joined: Jul 08, 2003
Posts: 24199

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.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: stopping a thread
jQuery in Action, 3rd edition