This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
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

Regain Access to Running Thread without passing reference  RSS feed

 
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
Boost this thread!