X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fruntime.c;h=4e6e08c2b3ec778a3842f87c84dc773d984bf343;hb=379436fcf5258ac83c27c0dc469eb6cfc80e0b7b;hp=1c41c797db4fa2c235cd84398bf04cdf7f45541b;hpb=32f2f7c898abd259b447eb318e9664e518ea6807;p=mono.git diff --git a/mono/metadata/runtime.c b/mono/metadata/runtime.c index 1c41c797db4..4e6e08c2b3e 100644 --- a/mono/metadata/runtime.c +++ b/mono/metadata/runtime.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -57,6 +57,7 @@ mono_runtime_is_shutting_down (void) static void fire_process_exit_event (MonoDomain *domain, gpointer user_data) { + MonoError error; MonoClassField *field; gpointer pa [2]; MonoObject *delegate, *exc; @@ -70,7 +71,8 @@ fire_process_exit_event (MonoDomain *domain, gpointer user_data) pa [0] = domain; pa [1] = NULL; - mono_runtime_delegate_invoke (delegate, pa, &exc); + mono_runtime_delegate_try_invoke (delegate, pa, &exc, &error); + mono_error_cleanup (&error); } static void @@ -108,7 +110,7 @@ mono_runtime_try_shutdown (void) mono_runtime_set_shutting_down (); /* This will kill the tp threads which cannot be suspended */ - mono_threadpool_ms_cleanup (); + mono_threadpool_cleanup (); /*TODO move the follow to here: mono_thread_suspend_all_other_threads (); OR mono_thread_wait_all_other_threads @@ -136,5 +138,25 @@ void mono_runtime_init_tls (void) { mono_marshal_init_tls (); - mono_thread_init_tls (); } + +char* +mono_runtime_get_aotid (void) +{ + int i; + guint8 aotid_sum = 0; + MonoDomain* domain = mono_domain_get (); + + if (!domain->entry_assembly || !domain->entry_assembly->image) + return NULL; + + guint8 (*aotid)[16] = &domain->entry_assembly->image->aotid; + + for (i = 0; i < 16; ++i) + aotid_sum |= (*aotid)[i]; + + if (aotid_sum == 0) + return NULL; + + return mono_guid_to_string ((guint8*) aotid); +} \ No newline at end of file