From: "Adam Heath" <[email protected]>
[email protected] wrote:
Author: jaz
Date: Fri May 1 17:47:52 2009
New Revision: 770771
URL: http://svn.apache.org/viewvc?rev=770771&view=rev
Log:
Often thread pools do not clear ThreadLocal, implemented a workaround to handle
this
Actually, never, until the Thread is shutdown. ThreadLocal is just
for storing stuff against a thread-type key. What you want is a
PoolThreadLocal, which doesn't exist.
I guess I could add code to support the same thing that webslinger
does for this case. It would require modifying ControlServlet,
JobPoller, and any other pool-like container class, to add a hook to
run an AtExit list of hooks. Then, add a utility class that allows
for singleton per-thread calls, and at-exit calls when the pool
returns the thread for further processing.
Actually it's very clear!
Jacques
If this sounds confusing, it's that it's difficult for me to explain,
and would just be easier if I add the feature(or otherwise show the code).