+1999-10-18 Tom Tromey <tromey@cygnus.com>
+
+ * gnu/gcj/runtime/VMClassLoader.java (getVMClassLoader): New
+ method.
+ (redirect): New static field.
+ * java/lang/ClassLoader.java (getSystemClassLoader): Now
+ native
+ (getVMClassLoader0): Removed.
+ * java/lang/natClassLoader.cc (getVMClassLoader0): Removed.
+ (redirect): Removed.
+ (getSystemClassLoader): Implemented.
+
1999-10-16 Anthony Green <green@cygnus.com>
* java/lang/ClassLoader.java (getSystemResource): Use
*/
protected final native Class findSystemClass(String name)
throws java.lang.ClassNotFoundException, java.lang.LinkageError;
+
+ // Return the sole VMClassLoader.
+ private static synchronized VMClassLoader getVMClassLoader ()
+ {
+ if (redirect == null)
+ redirect = new VMClassLoader ();
+ return redirect;
+ }
+
+ // The only VMClassLoader that can exist.
+ private static VMClassLoader redirect;
}
return parent;
}
- private static native ClassLoader getVMClassLoader0 ();
-
- static public ClassLoader getSystemClassLoader () {
- if (system == null)
- system = getVMClassLoader0 ();
- return system;
- }
+ public static native ClassLoader getSystemClassLoader ();
/**
* Creates a <code>ClassLoader</code> with no parent.
/////////// java.lang.ClassLoader native methods ////////////
-static gnu::gcj::runtime::VMClassLoader *redirect = 0;
-
-java::lang::ClassLoader*
-java::lang::ClassLoader::getVMClassLoader0 ()
+java::lang::ClassLoader *
+java::lang::ClassLoader::getSystemClassLoader (void)
{
- if (redirect == 0)
- redirect = new gnu::gcj::runtime::VMClassLoader;
- return redirect;
+ JvSynchronize sync (&ClassLoaderClass);
+ if (! system)
+ system = gnu::gcj::runtime::VMClassLoader::getVMClassLoader ();
+ return system;
}
void