File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes ThreadLocal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "ThreadLocal" Watch "ThreadLocal" New topic


Cory Wilkerson
Ranch Hand

Joined: Aug 14, 2001
Posts: 84
Looking to clarify here:

If threads foo, bar, and fizzle all create instances of class X -- can I simply call: X.local.get() (from the context of each thread) and be returned the long associated with "local" when the X instance was created?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

Yes, that's right.
[ July 11, 2003: Message edited by: Ernest Friedman-Hill ]

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: ThreadLocal
It's not a secret anymore!