• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regain Access to Running Thread without passing reference

 
Thomas Martin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy! my question is if I can regain access to a thread that is running from different classes without directly passing a reference?

Consider:


Inputs highly appreciated!
Thanks, T.
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always access the currently running Thread by doing Thread.currentThread(). In your case, I wouldn't extend Thread at all. Use a Runnable object instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic