2003-07-22 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Tue, 22 Jul 2003 09:51:42 +0000 (09:51 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 22 Jul 2003 09:51:42 +0000 (09:51 -0000)
* interp.c: Use the new metadata_section lock instead of metadata_lock.
Patch by Bernie Solomon (bernard@ugsolutions.com).

svn path=/trunk/mono/; revision=16520

mono/interpreter/ChangeLog
mono/interpreter/interp.c

index 3e1b007fd463a67a580812d93b7267fc47983a71..549280e2d7159e4f6a979c54d9672c7e14d8c88f 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
+
+       * interp.c: Use the new metadata_section lock instead of metadata_lock.
+       Patch by Bernie Solomon (bernard@ugsolutions.com).
 
 Fri Jul 18 15:11:44 CEST 2003 Paolo Molaro <lupus@ximian.com>
 
index 6dec06cbfc68135df7bb2855a428e70bdfa610e2..289e39a8694855969f477b66a3c2cd5d3386b33c 100644 (file)
@@ -841,8 +841,6 @@ dump_frame (MonoInvocation *inv)
        return g_string_free (str, FALSE);
 }
 
-static CRITICAL_SECTION metadata_lock;
-
 typedef enum {
        INLINE_STRING_LENGTH = 1,
        INLINE_ARRAY_LENGTH,
@@ -895,7 +893,7 @@ calc_offsets (MonoImage *image, MonoMethod *method)
        offsets [1] = offset;
 
        /* FIXME: This might cause a deadlock with domain->lock */
-       EnterCriticalSection (&metadata_lock);
+       EnterCriticalSection (metadata_section);
        /* intern the strings in the method. */
        ip = header->code;
        end = ip + header->code_size;
@@ -993,7 +991,7 @@ calc_offsets (MonoImage *image, MonoMethod *method)
                if (strcmp (method->name, "GetElementType") == 0)
                        method->addr = GUINT_TO_POINTER (INLINE_TYPE_ELEMENT_TYPE);
        }
-       LeaveCriticalSection (&metadata_lock);
+       LeaveCriticalSection (metadata_section);
        mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
 }
 
@@ -4506,6 +4504,8 @@ quit_function (MonoDomain *domain, gpointer user_data)
 
 }
 
+static CRITICAL_SECTION ms;
+
 int 
 main (int argc, char *argv [])
 {
@@ -4582,7 +4582,8 @@ main (int argc, char *argv [])
        mono_install_stack_walk (interp_walk_stack);
        mono_runtime_install_cleanup (quit_function);
 
-       InitializeCriticalSection (&metadata_lock);
+       metadata_section = &ms;
+       InitializeCriticalSection (metadata_section);
        domain = mono_init (file);
        mono_runtime_init (domain, NULL, NULL);