On Thu, 2006-03-23 at 09:05 -0600, Clebert Suconic wrote:
> > I don't even know what ThreadPool changes you are referring to, are
> they real or proposed?
> 
> I thought we had some changes on the ThreadPools. My bad.
> I meant that because of references through ThreadWithAttributes (they
> will be always appear for some reason on JVMTI).
> 
> 
> Anyway, I need to know if a Thread is cleared
> (Thread.setContextClassLoader(somethingElse) before the Thread goes to
> sleep.
> If the Thread keeps the ClassLoader reference until next request, that
> will make my life harder creating a TestCase structure for testing
> redeployment/classLeakages.

All code should be switching and restoring the classloader
during the invocations.  Anything else is a bug.

ClassLoader old = tcl;
tcl = myClassLoader
try
{
}
finally
{
tcl = old;
}

Of course if something (e.g. an MBean)
that is hotdeployed starts a thread
and doesn't stop it at undeployment then it will leak
the classloader. But that is also a bug.
-- 
xxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss Inc.
xxxxxxxxxxxxxxxxxxxxxxxx



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to