private static ThreadLocal threadLocalProperties=new InheritableThreadLocal(); // notice "static" there
public static ThreadLocalProperties getLocalProperties() { // static too
ThreadLocalProperties properties=(ThreadLocalProperties)threadLocalProperties.get();
if (properties==null) threadLocalProperties.set(properties=new ThreadLocalProperties());
return properties;
}
Are you sure the current implementation works?
- Alexey.
Matt Benson wrote:
You said they are created via the ITL get()? So does it look like there are lots of Threads but when they did their ITLs instances aren't getting cleaned up? Or does it rather look like we are creating more LocalPropertyStacks than necessary?
-Matt
--- Martijn Kruithof <[EMAIL PROTECTED]> wrote:
I can see from traces I added to the code that
thousands of LocalPropertyStacks
are created via the |InheritableThreadLocal|,
[snip]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]