This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Regain Access to Running Thread without passing reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Regain Access to Running Thread without passing reference" Watch "Regain Access to Running Thread without passing reference" New topic
Author

Regain Access to Running Thread without passing reference

Thomas Martin
Greenhorn

Joined: Mar 10, 2005
Posts: 2
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

Joined: Feb 20, 2001
Posts: 580
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.


James Carman, President<br />Carman Consulting, Inc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regain Access to Running Thread without passing reference