aspose file tools*
The moose likes Java in General and the fly likes TimerTask cancel() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "TimerTask cancel()" Watch "TimerTask cancel()" New topic
Author

TimerTask cancel()

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
TimerTask has a cancel() method. If I have a repeated run schedule, this call forces the next scheduled run not to happen. But does it kill the thread ?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19074
    
  40

Originally posted by Raj Ohadi:
TimerTask has a cancel() method. If I have a repeated run schedule, this call forces the next scheduled run not to happen. But does it kill the thread ?


No, it does not kill the thread. If you want to do that, you need to call the cancel() method of the Timer itself.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TimerTask cancel()