[infinispan-dev] Clean ThreadLocals

Pedro Ruivo pedro at infinispan.org
Wed Dec 11 17:47:01 EST 2013


Hi,

I've created a method to clean a specific ThreadLocal variable from all 
live threads [1].

My goal is to clean the ThreadLocal variables after a cache stops. It's 
kind expensive method (it uses reflection) but I think it is fine.

Currently, I'm using it to clear the Marshaller ThreadLocal in here [2].

Does anyone see any problem with this approach? Maybe it can be used in 
other possible leaking ThreadLocals?

Cheers,
Pedro

[1] 
https://github.com/infinispan/infinispan/pull/2275/files#diff-212dc0b4165cfee5f764904e5613732fR49
[2] 
https://github.com/infinispan/infinispan/pull/2275/files#diff-dd0f48af603a174d9143f2bf7f1d5c56R189



More information about the infinispan-dev mailing list