+gboolean
+mono_debugger_abort_runtime_invoke ()
+{
+ MonoInternalThread *thread = mono_thread_internal_current ();
+ MonoDebuggerThreadInfo *thread_info;
+
+ mono_debugger_lock ();
+
+ thread_info = find_debugger_thread_info (thread);
+ if (!thread_info) {
+ mono_debugger_unlock ();
+ return FALSE;
+ }
+
+ if ((thread_info->internal_flags & MONO_DEBUGGER_INTERNAL_THREAD_FLAGS_IN_RUNTIME_INVOKE) == 0) {
+ mono_debugger_unlock ();
+ return FALSE;
+ }
+
+ if ((thread_info->internal_flags & MONO_DEBUGGER_INTERNAL_THREAD_FLAGS_ABORT_REQUESTED) != 0) {
+ mono_debugger_unlock ();
+ return TRUE;
+ }
+
+ thread_info->internal_flags |= MONO_DEBUGGER_INTERNAL_THREAD_FLAGS_ABORT_REQUESTED;
+ ves_icall_System_Threading_Thread_Abort (thread_info->thread, NULL);
+
+ mono_debugger_unlock ();
+ return TRUE;
+}
+