MonoMemoryManager *mm = mono_mem_manager_get_generic (data.images, data.nimages);
collect_data_free (&data);
- mono_mem_manager_lock (mm);
+ // Hashtable key equal func can take loader lock
+ mono_loader_lock ();
if (!mm->ginst_cache)
mm->ginst_cache = g_hash_table_new_full (mono_metadata_generic_inst_hash, mono_metadata_generic_inst_equal, NULL, (GDestroyNotify)free_generic_inst);
g_hash_table_insert (mm->ginst_cache, ginst, ginst);
}
- mono_mem_manager_unlock (mm);
+ mono_loader_unlock ();
return ginst;
}
g_assert (candidate->count > 0);
MonoMemoryManager *mm = mono_metadata_get_mem_manager_for_aggregate_modifiers (candidate);
- mono_mem_manager_lock (mm);
+ // Hashtable key equal func can take loader lock
+ mono_loader_lock ();
if (!mm->aggregate_modifiers_cache)
mm->aggregate_modifiers_cache = g_hash_table_new_full (aggregate_modifiers_hash, aggregate_modifiers_equal, NULL, (GDestroyNotify)free_aggregate_modifiers);
g_hash_table_insert (mm->aggregate_modifiers_cache, amods, amods);
}
- mono_mem_manager_unlock (mm);
+ mono_loader_unlock ();
return amods;
}
if (gclass)
return gclass;
- mono_mem_manager_lock (mm);
+ // Hashtable key equal func can take loader lock
+ mono_loader_lock ();
gclass = mono_mem_manager_alloc0 (mm, sizeof (MonoGenericClass));
if (is_dynamic)
// g_hash_table_insert (set->gclass_cache, gclass, gclass);
- mono_mem_manager_unlock (mm);
+ mono_loader_unlock ();
return gclass2;
}