X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mono%2Fmini%2Fmini-darwin.c;h=027b0872049e1df1c0496b23d7c656b1cfe5a899;hb=9852e7da8c00f2bcbf483211832563a63178101a;hp=96fdb5e7cae0a69d7e382c28e4fafe950450df55;hpb=9b3232e7df30dc895bf1d033196d106ae555c4a0;p=mono.git diff --git a/mono/mini/mini-darwin.c b/mono/mini/mini-darwin.c index 96fdb5e7cae..027b0872049 100644 --- a/mono/mini/mini-darwin.c +++ b/mono/mini/mini-darwin.c @@ -96,6 +96,15 @@ typedef struct { /* The exception port */ static mach_port_t mach_exception_port = VM_MAP_NULL; +kern_return_t +catch_exception_raise ( + mach_port_t exception_port, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count); + /* * Implicitly called by exc_server. Must be public. * @@ -149,13 +158,17 @@ mach_exception_thread (void *arg) MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - g_assert (result == MACH_MSG_SUCCESS); + /* + If we try to abort the thread while delivering an exception. The port will be gone since the kernel + setup a send once port to deliver the resume message and thread_abort will consume it. + */ + g_assert (result == MACH_MSG_SUCCESS || result == MACH_SEND_INVALID_DEST); } return NULL; } static void -macosx_register_exception_handler () +macosx_register_exception_handler (void) { mach_port_t task; pthread_attr_t attr; @@ -197,6 +210,8 @@ macosx_register_exception_handler () /* This is #define'd by Boehm GC to _GC_dlopen. */ #undef dlopen +void* dlopen(const char* path, int mode); + void mono_runtime_install_handlers (void) { @@ -299,9 +314,8 @@ mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoNativeThrea domain = mono_mach_arch_get_tls_value_from_thread (thread_id, domain_key); /*Thread already started to cleanup, can no longer capture unwind state*/ - if (!jit_tls) + if (!jit_tls || !domain) return FALSE; - g_assert (domain); #if defined (MONO_ARCH_ENABLE_MONO_LMF_VAR) lmf_key = mono_get_lmf_tls_offset ();