Author: mprobst
Date: 2007-12-10 09:06:33 -0500 (Mon, 10 Dec 2007)
New Revision: 91045

Modified:
   branches/mono-1-2-6/mono/mono/metadata/ChangeLog
   branches/mono-1-2-6/mono/mono/metadata/gc.c
Log:
2007-12-10  Mark Probst  <[EMAIL PROTECTED]>

        * gc.c: Don't delay threadpool thread finalization unless Mono is
        shutting down.


Modified: branches/mono-1-2-6/mono/mono/metadata/ChangeLog
===================================================================
--- branches/mono-1-2-6/mono/mono/metadata/ChangeLog    2007-12-10 13:59:46 UTC 
(rev 91044)
+++ branches/mono-1-2-6/mono/mono/metadata/ChangeLog    2007-12-10 14:06:33 UTC 
(rev 91045)
@@ -1,5 +1,10 @@
 2007-12-10  Mark Probst  <[EMAIL PROTECTED]>
 
+       * gc.c: Don't delay threadpool thread finalization unless Mono is
+       shutting down.
+
+2007-12-10  Mark Probst  <[EMAIL PROTECTED]>
+
        * gc.c, gc-internal.h: Don't finalize threadpool threads with
        other objects, because the threadpool is still around.  Put them
        in a list instead and after finalizing all other objects in the

Modified: branches/mono-1-2-6/mono/mono/metadata/gc.c
===================================================================
--- branches/mono-1-2-6/mono/mono/metadata/gc.c 2007-12-10 13:59:46 UTC (rev 
91044)
+++ branches/mono-1-2-6/mono/mono/metadata/gc.c 2007-12-10 14:06:33 UTC (rev 
91045)
@@ -38,6 +38,8 @@
 
 static gboolean gc_disabled = FALSE;
 
+static gboolean finalizing_root_domain = FALSE;
+
 #define mono_finalizer_lock() EnterCriticalSection (&finalizer_mutex)
 #define mono_finalizer_unlock() LeaveCriticalSection (&finalizer_mutex)
 static CRITICAL_SECTION finalizer_mutex;
@@ -99,9 +101,10 @@
                        /* Avoid finalizing ourselves */
                        return;
 
-               if (t->threadpool_thread) {
-                       /* Don't finalize threadpool threads - they're
-                          finalized when the threadpool shuts down. */
+               if (t->threadpool_thread && finalizing_root_domain) {
+                       /* Don't finalize threadpool threads when
+                          shutting down - they're finalized when the
+                          threadpool shuts down. */
                        add_thread_to_finalize (t);
                        return;
                }
@@ -269,6 +272,9 @@
        req = g_new0 (DomainFinalizationReq, 1);
        req->domain = domain;
        req->done_event = done_event;
+
+       if (domain == mono_get_root_domain ())
+               finalizing_root_domain = TRUE;
        
        mono_finalizer_lock ();
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to