This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Deadlock in java.net.URLClassLoader
- From: Tom Tromey <tromey at redhat dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: classpath at gnu dot org, java at gcc dot gnu dot org
- Date: 22 Aug 2005 11:43:23 -0600
- Subject: Re: Deadlock in java.net.URLClassLoader
- References: <17156.31023.613650.956641@zapata.pink>
- Reply-to: tromey at redhat dot com
>>>>> "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.
Tom