2009-01-26 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Mon, 26 Jan 2009 06:42:08 +0000 (06:42 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 26 Jan 2009 06:42:08 +0000 (06:42 -0000)
* exceptions-amd64.c (mono_arch_exceptions_init): Call
get_throw_pending_exception () to avoid initialization races.

* mini-exceptions.c (mono_exceptions_init): Call an arch specific
mono_arch_exceptions_init () function.

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

mono/mini/ChangeLog
mono/mini/exceptions-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-exceptions.c

index 6117fe871c62b8c6e76d17f653c4d163c2f305c2..1b8c53891ecf2342bc1f89281c439ef93fc5c530 100644 (file)
@@ -1,5 +1,11 @@
 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
 
+       * exceptions-amd64.c (mono_arch_exceptions_init): Call 
+       get_throw_pending_exception () to avoid initialization races.
+
+       * mini-exceptions.c (mono_exceptions_init): Call an arch specific
+       mono_arch_exceptions_init () function.
+
        * mini.h (MONO_INST_NEW): Remove duplicate setting of cil_code.
 
 2009-01-25  Zoltan Varga  <vargaz@gmail.com>
index e29fa319be15d025cf00e11ab1b6339986459c4a..0b07fb860162eebf0dad15a3f309318ac6f7d469 100644 (file)
@@ -1061,6 +1061,13 @@ mono_arch_notify_pending_exc (void)
        *(gpointer*)(lmf->rsp - 8) = get_throw_pending_exception ();
 }
 
+void
+mono_arch_exceptions_init (void)
+{
+       /* Call this to avoid initialization races */
+       get_throw_pending_exception ();
+}
+
 #ifdef PLATFORM_WIN32
 
 /*
index eb54ccc5b1fcc866817816a87fe235a5b2362e6c..4587abd1e123306a9cdd500466a8f7fde4b9b2dc 100644 (file)
@@ -312,6 +312,7 @@ typedef struct {
 #define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1
 #define MONO_ARCH_HAVE_CMOV_OPS 1
 #define MONO_ARCH_HAVE_NOTIFY_PENDING_EXC 1
+#define MONO_ARCH_HAVE_EXCEPTIONS_INIT 1
 #define MONO_ARCH_ENABLE_GLOBAL_RA 1
 #define MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK 1
 #if !defined(PLATFORM_WIN32) && !defined(HAVE_MOVING_COLLECTOR)
index c1a47d83878555b7f4e3ccf3577a4d2ffd2f50b0..fdeb664487aa4b47f9bd40dc920dd979c1eba707 100644 (file)
@@ -86,6 +86,10 @@ mono_exceptions_init (void)
        try_more_restore_tramp = mono_create_specific_trampoline (try_more_restore, MONO_TRAMPOLINE_RESTORE_STACK_PROT, mono_domain_get (), NULL);
        restore_stack_protection_tramp = mono_create_specific_trampoline (restore_stack_protection, MONO_TRAMPOLINE_RESTORE_STACK_PROT, mono_domain_get (), NULL);
 #endif
+
+#ifdef MONO_ARCH_HAVE_EXCEPTIONS_INIT
+       mono_arch_exceptions_init ();
+#endif
 }
 
 gpointer