This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Deadlock in java.net.URLClassLoader


Tom Tromey writes:
 > >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
 > 
 > Andrew> What happens is that one thread does ClassLoader.loadClass, which is
 > Andrew> synchronized on the loader, and then URLClassLoader calls toString(),
 > Andrew> which is synchronized on urlloaders.
 > 
 > Another choice would be to simply synchronize on the loader and never
 > synchronize on urlloaders.  There doesn't seem to be a particular
 > advantage to having two different locks here.

That sounds like an excellent soloution to the problem, and it never
occurred to me.  I'll re-submit.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]