From 220e1c813186d567906200bf2a33f9e425ac0f8a Mon Sep 17 00:00:00 2001 From: Paolo Molaro Date: Thu, 5 Dec 2002 15:34:04 +0000 Subject: [PATCH] Use a #define to enable/disable the finalizer thread. svn path=/trunk/mono/; revision=9396 --- mono/metadata/gc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c index 2b8820681e1..e22999a465f 100644 --- a/mono/metadata/gc.c +++ b/mono/metadata/gc.c @@ -433,18 +433,20 @@ static guint32 finalizer_thread (gpointer unused) return(0); } +/* + * Enable or disable the separate finalizer thread. + * It's currently disabled because it still requires some + * work in the rest of the runtime. + */ +#undef ENABLE_FINALIZER_THREAD + void mono_gc_init (void) { HANDLE gc_thread; InitializeCriticalSection (&handle_section); - /* - * A return here disables the separate finalizer thread. - * It's currently disabled because it still requires some - * work in the rest of the runtime. - */ - return; +#ifdef ENABLE_FINALIZER_THREAD if (getenv ("GC_DONT_GC")) return; @@ -465,6 +467,7 @@ void mono_gc_init (void) if (gc_thread == NULL) { g_assert_not_reached (); } +#endif } void mono_gc_cleanup (void) @@ -473,8 +476,10 @@ void mono_gc_cleanup (void) g_message (G_GNUC_PRETTY_FUNCTION ": cleaning up finalizer"); #endif +#ifdef ENABLE_FINALIZER_THREAD finished = TRUE; finalize_notify (); +#endif } #else -- 2.25.1