Author: zoltan
Date: 2005-04-28 15:49:34 -0400 (Thu, 28 Apr 2005)
New Revision: 43743
Modified:
trunk/mono/mono/mini/mini.c
Log:
2005-04-28 Zoltan Varga <[EMAIL PROTECTED]>
* mini.c (mini_cleanup): Skip the freeing of the runtime structures
for now, since some threads might still be running.
Modified: trunk/mono/mono/mini/mini.c
===================================================================
--- trunk/mono/mono/mini/mini.c 2005-04-28 19:46:53 UTC (rev 43742)
+++ trunk/mono/mono/mini/mini.c 2005-04-28 19:49:34 UTC (rev 43743)
@@ -9629,10 +9629,18 @@
{
gboolean running_managed;
MonoException *exc;
+ void *ji;
- GET_CONTEXT
+ GET_CONTEXT;
- running_managed = (mono_jit_info_table_find (mono_domain_get (),
mono_arch_ip_from_context(ctx)) != NULL);
+ /*
+ * FIXME:
+ * This is an async signal, so the code below must not call anything
which
+ * is not async safe. That includes the pthread locking functions. If we
+ * know that we interrupted managed code, then locking is safe.
+ */
+ ji = mono_jit_info_table_find (mono_domain_get (),
mono_arch_ip_from_context(ctx));
+ running_managed = ji != NULL;
exc = mono_thread_request_interruption (running_managed);
if (!exc) return;
@@ -10081,6 +10089,19 @@
*/
mono_domain_finalize (domain, 2000);
+ /*
+ * Since the runtime does not suspend/abort running threads when
exiting,
+ * freeing up JIT structures could cause crashes in those threads. So
skip
+ * that for the moment.
+ */
+
+ /*
+ * This is not safe but people running profilers hopefully do not
+ * use threads.
+ */
+ mono_profiler_shutdown ();
+ return;
+
mono_runtime_cleanup (domain);
mono_profiler_shutdown ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches