diff options
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) { |