Merge pull request #3936 from kumpera/monoclass_reorg2
[mono.git] / mono / metadata / class.c
index a91a33a4bbfa9b025c34475a9dc7160e5e9782b7..3f54ba7397c04d4e32e998a530b0d2a32b7bfd1c 100644 (file)
@@ -3551,6 +3551,8 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
        int num_array_interfaces;
        int is_enumerator = FALSE;
 
+       mono_loader_lock ();
+
        mono_class_setup_supertypes (klass);
        /* 
         * get the implicit generic interfaces for either the arrays or for System.Array/InternalEnumerator<T>
@@ -3711,8 +3713,6 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
        }
 
        /* Publish the data */
-       mono_loader_lock ();
-
        klass->max_interface_id = max_iid;
        /*
         * We might get called multiple times:
@@ -3754,9 +3754,9 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
                klass->interface_bitmap = bitmap;
 #endif
        }
+end:
        mono_loader_unlock ();
 
-end:
        g_free (interfaces_full);
        g_free (interface_offsets_full);
        g_free (array_interfaces);