URLClassLoader.java (addURLImpl): Synchronize on the loader.

2005-09-08  Andrew Haley  <aph@redhat.com>

	* java/net/URLClassLoader.java (addURLImpl): Synchronize on the
	loader.
	(toString): Likewise.

From-SVN: r104095
This commit is contained in:
Andrew Haley 2005-09-09 13:06:24 +00:00 committed by Andrew Haley
parent ddef717308
commit 13d7d8745b
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2005-09-08 Andrew Haley <aph@redhat.com>
* java/net/URLClassLoader.java (addURLImpl): Synchronize on the
loader.
(toString): Likewise.
2005-09-08 Andrew Haley <aph@redhat.com> 2005-09-08 Andrew Haley <aph@redhat.com>
PR java/22084 PR java/22084

View file

@ -880,7 +880,7 @@ public class URLClassLoader extends SecureClassLoader
private void addURLImpl(URL newUrl) private void addURLImpl(URL newUrl)
{ {
synchronized (urlloaders) synchronized (this)
{ {
if (newUrl == null) if (newUrl == null)
return; // Silently ignore... return; // Silently ignore...
@ -1111,7 +1111,7 @@ public class URLClassLoader extends SecureClassLoader
*/ */
public String toString() public String toString()
{ {
synchronized (urlloaders) synchronized (this)
{ {
if (thisString == null) if (thisString == null)
{ {