• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to kill a thread?  RSS feed

 
Ilya PA
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm wrighting a program where i have to start a thread, then kill it by command and start again. Is there any way to do that? Is there anything like the depricated stop() method?
 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ilya,
Once a thread starts and its run() method returns, that thread cannot be restarted.
I'd guess that, if you are working with multiple threads, you probably want the functionality that is provided by the wait() and notify() methods. Check the API for more info on those methods, or do a search at this site.
Hope that helps.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!