Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stopping a thread  RSS feed

 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am very new to threads, but I seem to remember there exists a better way to stop a thread than "stop()". I've been looking around the documentation and am not finding the source of my thoughts.
Comments?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could it be the API? If you look up java.lang.Thread.stop() it links you to this page:

http://java.sun.com/j2se/1.3/docs/guide/misc/threadPrimitiveDeprecation.html
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Not sure why I didn't see this tonight. Is there any difference in using these ideas in applets or an application?
Thanks again.
 
rohit poduval
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How abt doing a join() and waiting for the thread to die?
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does doing a join affect the thread? What are you "joining"?
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joining a thread simply means waiting for it to finish.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!