[threads] Remove mono_thread_notify_pending_exc_fn dead code
authorLudovic Henry <ludovic@xamarin.com>
Tue, 2 Feb 2016 11:30:59 +0000 (11:30 +0000)
committerLudovic Henry <ludovic@xamarin.com>
Thu, 4 Feb 2016 13:40:16 +0000 (13:40 +0000)
mono/metadata/threads-types.h
mono/metadata/threads.c

index d90e8e122fcbbf5b9e85dfcee4046330a128d1af..86a01a481f359aa6d66197bdde3ed223877cddcf 100644 (file)
@@ -219,8 +219,6 @@ MonoException* mono_thread_get_and_clear_pending_exception (void);
 
 void mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean managed);
 
-void mono_threads_install_notify_pending_exc (MonoThreadNotifyPendingExcFunc func);
-
 void mono_runtime_set_has_tls_get (gboolean val);
 gboolean mono_runtime_has_tls_get (void);
 
index 07374817bd85d116fab962c9bc05af6e5dea3334..668b31e3268b355472cfb272cc31ed6b7fecc66c 100644 (file)
@@ -192,9 +192,6 @@ static MonoThreadAttachCB mono_thread_attach_cb = NULL;
 /* function called at thread cleanup */
 static MonoThreadCleanupFunc mono_thread_cleanup_fn = NULL;
 
-/* function called to notify the runtime about a pending exception on the current thread */
-static MonoThreadNotifyPendingExcFunc mono_thread_notify_pending_exc_fn = NULL;
-
 /* The default stack size for each thread */
 static guint32 default_stacksize = 0;
 #define default_stacksize_for_thread(thread) ((thread)->stack_size? (thread)->stack_size: default_stacksize)
@@ -2845,11 +2842,6 @@ mono_thread_set_manage_callback (MonoThread *thread, MonoThreadManageCallback fu
        thread->internal_thread->manage_callback = func;
 }
 
-void mono_threads_install_notify_pending_exc (MonoThreadNotifyPendingExcFunc func)
-{
-       mono_thread_notify_pending_exc_fn = func;
-}
-
 G_GNUC_UNUSED
 static void print_tids (gpointer key, gpointer value, gpointer user)
 {
@@ -4408,11 +4400,6 @@ mono_thread_request_interruption (gboolean running_managed)
                   request count. When exiting the unmanaged method the count will be
                   checked and the thread will be interrupted. */
 
-               if (mono_thread_notify_pending_exc_fn && !running_managed)
-                       /* The JIT will notify the thread about the interruption */
-                       /* This shouldn't take any locks */
-                       mono_thread_notify_pending_exc_fn (NULL);
-
                /* this will awake the thread if it is in WaitForSingleObject 
                   or similar */
                /* Our implementation of this function ignores the func argument */
@@ -4717,10 +4704,6 @@ abort_thread_critical (MonoThreadInfo *info, gpointer ud)
                        mono_thread_info_setup_async_call (info, self_interrupt_thread, NULL);
                return MonoResumeThread;
        } else {
-               if (mono_thread_notify_pending_exc_fn)
-                       /* The JIT will notify the thread about the interruption */
-                       mono_thread_notify_pending_exc_fn (info);
-
                /* 
                 * This will cause waits to be broken.
                 * It will also prevent the thread from entering a wait, so if the thread returns
@@ -4790,10 +4773,7 @@ suspend_thread_critical (MonoThreadInfo *info, gpointer ud)
                        InterlockedIncrement (&thread_interruption_requested);
                if (data->interrupt)
                        data->interrupt_token = mono_thread_info_prepare_interrupt ((MonoThreadInfo *)thread->thread_info);
-               
-               if (mono_thread_notify_pending_exc_fn && !running_managed)
-                       /* The JIT will notify the thread about the interruption */
-                       mono_thread_notify_pending_exc_fn (info);
+
                return MonoResumeThread;
        }
 }