Update test
[mono-project.git] / mono / metadata / runtime.c
blob276a519f0d3d7d8b5b9bcd52dd0057367ebdf1f4
1 /*
2 * runtime.c: Runtime functions
4 * Authors:
5 * Jonathan Pryor
7 * Copyright 2010 Novell, Inc (http://www.novell.com)
8 */
10 #include <config.h>
12 #include <glib.h>
14 #include <mono/metadata/appdomain.h>
15 #include <mono/metadata/class.h>
16 #include <mono/metadata/class-internals.h>
17 #include <mono/metadata/runtime.h>
18 #include <mono/metadata/monitor.h>
20 static void
21 fire_process_exit_event (MonoDomain *domain, gpointer user_data)
23 MonoClassField *field;
24 gpointer pa [2];
25 MonoObject *delegate, *exc;
27 field = mono_class_get_field_from_name (mono_defaults.appdomain_class, "ProcessExit");
28 g_assert (field);
30 delegate = *(MonoObject **)(((char *)domain->domain) + field->offset);
31 if (delegate == NULL)
32 return;
34 pa [0] = domain;
35 pa [1] = NULL;
36 mono_runtime_delegate_invoke (delegate, pa, &exc);
39 void
40 mono_runtime_shutdown (void)
42 mono_domain_foreach (fire_process_exit_event, NULL);
46 gboolean
47 mono_runtime_is_critical_method (MonoMethod *method)
49 if (mono_monitor_is_il_fastpath_wrapper (method))
50 return TRUE;
51 return FALSE;