+2009-02-11 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
+ mono_image_unlock.
+
+ * image.c (mono_image_init): Init the lock field.
+
+ * image.c (mono_image_init): Cleanup the lock field.
+
+ * image.c: Add mono_image_(un)lock functions.
+
2009-02-11 Mark Probst <mark.probst@gmail.com>
* class.c, class-internals.h: mono_method_get_context_general()
* loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
* loader.c (mono_loader_lock): Add a comment pointing to the locking document.
-
+
2009-02-11 Rodrigo Kumpera <rkumpera@novell.com>
* metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
image->method_signatures = g_hash_table_new (NULL, NULL);
image->property_hash = mono_property_hash_new ();
+ InitializeCriticalSection (&image->lock);
}
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
mono_mempool_destroy (image->mempool);
}
+ DeleteCriticalSection (&image->lock);
+
mono_profiler_module_event (image, MONO_PROFILE_END_UNLOAD);
}
return mono_mempool_strdup (image->mempool, s);
}
+void
+mono_image_lock (MonoImage *image)
+{
+ EnterCriticalSection (&image->lock);
+}
+
+void
+mono_image_unlock (MonoImage *image)
+{
+ LeaveCriticalSection (&image->lock);
+}
/* interfaces IDs from this image */
MonoBitSet *interface_bitset;
+
+ /*
+ * No other runtime locks must be taken while holding this lock.
+ * It's meant to be used only to mutate a query structures part of this image.
+ */
+ CRITICAL_SECTION lock;
};
enum {
char*
mono_image_strdup (MonoImage *image, const char *s) MONO_INTERNAL;
+void
+mono_image_lock (MonoImage *image) MONO_INTERNAL;
+
+void
+mono_image_unlock (MonoImage *image) MONO_INTERNAL;
+
MonoType*
mono_metadata_get_shared_type (MonoType *type) MONO_INTERNAL;