* Use g_slist_concat ().
* Add MemoryManagerLock to the lock tracer.
* Remove some dead code.
gboolean freeing;
// If taking this with the loader lock, always take this second
- // Currently unused, we take the domain lock instead
MonoCoopMutex lock;
// Private, don't access directly
void
mono_alc_assemblies_unlock (MonoAssemblyLoadContext *alc);
+/*
+ * This is below the loader lock in the locking hierarcy,
+ * so when taking this with the loader lock, always take
+ * this second.
+ */
void
mono_alc_memory_managers_lock (MonoAssemblyLoadContext *alc);
InvalidLock = 0,
LoaderLock,
ImageDataLock,
+ MemoryManagerLock,
DomainAssembliesLock,
DomainJitCodeHashLock,
IcallLock,
void
mono_mem_manager_lock (MonoMemoryManager *memory_manager)
{
- mono_coop_mutex_lock (&memory_manager->lock);
+ mono_locks_coop_acquire (&memory_manager->lock, MemoryManagerLock);
}
void
mono_mem_manager_unlock (MonoMemoryManager *memory_manager)
{
- mono_coop_mutex_unlock (&memory_manager->lock);
+ mono_locks_coop_release (&memory_manager->lock, MemoryManagerLock);
}
static inline void
vt->imt_collisions_bitmap |= imt_collisions_bitmap;
}
-static void
-build_imt (MonoClass *klass, MonoVTable *vt, gpointer* imt, GSList *extra_interfaces)
-{
- MONO_REQ_GC_NEUTRAL_MODE;
-
- mono_loader_lock ();
- build_imt_slots (klass, vt, imt, extra_interfaces, -1);
- mono_loader_unlock ();
-}
-
/**
* mono_vtable_build_imt_slot:
* \param vtable virtual object table struct
InterpMethod *target_imethod;
} InterpVTableEntry;
-static inline GSList*
-g_slist_append_node (GSList *list, GSList *new_list, gpointer data)
-{
- GSList *last;
-
- new_list->data = data;
- new_list->next = NULL;
-
- if (list) {
- last = list;
- while (last->next)
- last = last->next;
- last->next = new_list;
-
- return list;
- } else
- return new_list;
-}
-
/* memory manager lock must be held */
static GSList*
append_imethod (MonoMemoryManager *memory_manager, GSList *list, InterpMethod *imethod, InterpMethod *target_imethod)
entry->imethod = imethod;
entry->target_imethod = target_imethod;
ret = mono_mem_manager_alloc0 (memory_manager, sizeof (GSList));
- ret = g_slist_append_node (list, ret, entry);
+ ret->data = entry;
+ ret = g_slist_concat (list, ret);
return ret;
}