public class CloseableThreadLocal<T> extends Object implements Closeable
close()
, these hard
references are cleared and then GC is freely able to
reclaim space by objects stored in it.
We can not rely on ThreadLocal.remove()
as it
only removes the value for the caller thread, whereas
close()
takes care of all
threads. You should not call close()
until all
threads are done using the instance.Constructor and Description |
---|
CloseableThreadLocal() |
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.