diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-07 21:29:04 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-07 21:29:04 +0000 |
commit | daa4e295752aca4a0cda33ea5e05af597382d12d (patch) | |
tree | 9321a4ce5d93e720f8ccef64c5a68a48525104d1 /libjava/defineclass.cc | |
parent | cc57ce063492a870faaa15d9909e985ff3c0befb (diff) | |
download | gcc-daa4e295752aca4a0cda33ea5e05af597382d12d.tar.gz |
* defineclass.cc (handleClassBegin): Use
_Jv_RegisterInitiatingLoader.
* java/lang/Class.h (_Jv_UnregisterInitiatingLoader): Declare.
* java/lang/natVMClassLoader.cc (resolveClass): Don't register
class. Use _Jv_UnregisterInitiatingLoader.
* java/lang/natClassLoader.cc (_Jv_UnregisterInitiatingLoader):
New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94717 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/defineclass.cc')
-rw-r--r-- | libjava/defineclass.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc index a40bff1758e..382b321f591 100644 --- a/libjava/defineclass.cc +++ b/libjava/defineclass.cc @@ -908,16 +908,14 @@ _Jv_ClassReader::handleClassBegin (int access_flags, int this_class, int super_c throw_no_class_def_found_error ("loading java.lang.Object"); } - // In the pre-loading state, it can be looked up in the - // cache only by this thread! This allows the super-class - // to include references to this class. - def->state = JV_STATE_PRELOADING; - { - JvSynchronize sync (&java::lang::Class::class$); - _Jv_RegisterClass (def); - } + // Register this class with its defining loader as well (despite the + // name of the function we're calling), so that super class lookups + // work properly. If there is an error, our caller will unregister + // this class from the class loader. Also, we don't need to hold a + // lock here, as our caller has acquired it. + _Jv_RegisterInitiatingLoader (def, def->loader); if (super_class != 0) { |