mono_coop_mutex_unlock (thread->synch_cs);
}
+static inline gboolean
+is_appdomainunloaded_exception (MonoClass *klass)
+{
+ return klass == mono_class_get_appdomain_unloaded_exception_class ();
+}
+
+static inline gboolean
+is_threadabort_exception (MonoClass *klass)
+{
+ return klass == mono_defaults.threadabortexception_class;
+}
+
/*
* NOTE: this function can be called also for threads different from the current one:
* make sure no code called from it will ever assume it is run on the thread that is
if (!mono_error_ok (&error)) {
MonoException *ex = mono_error_convert_to_exception (&error);
- if (ex) {
+
+ g_assert (ex != NULL);
+ MonoClass *klass = mono_object_get_class (&ex->object);
+ if ((mono_runtime_unhandled_exception_policy_get () != MONO_UNHANDLED_POLICY_LEGACY) &&
+ !is_threadabort_exception (klass)) {
mono_unhandled_exception (&ex->object);
mono_invoke_unhandled_exception_hook (&ex->object);
g_assert_not_reached ();
}
void
-mono_thread_exit ()
+mono_thread_exit (void)
{
MonoInternalThread *thread = mono_thread_internal_current ();
mono_thread_interruption_checkpoint ();
}
-static inline gboolean
-is_appdomainunloaded_exception (MonoClass *klass)
-{
- return klass == mono_class_get_appdomain_unloaded_exception_class ();
-}
-
-static inline gboolean
-is_threadabort_exception (MonoClass *klass)
-{
- return klass == mono_defaults.threadabortexception_class;
-}
-
void
mono_thread_internal_unhandled_exception (MonoObject* exc)
{