[Gc] Fix win32 GC_allow_register_threads

Ivan Maidanski ivmai at mail.ru
Tue Nov 25 04:06:31 PST 2008


Hi!

This small patch fixes GC_allow_register_threads() (in "win32_thread.c" file only) for GC_DLL + ndef PARALLEL_MARK + ndef THREAD_LOCAL_ALLOC (+ GC_ASSERTIONS) config (since GC_init_parallel() is not called from GC_init_inner() in this case; GC_init_parallel() does nothing in this case so just setting "parallel_initialized" var is sufficient here). Not required for GC_allow_register_threads() in "pthread_support.c" file.

Bye.
-------------- next part --------------
diff -ru bdwgc/win32_threads.c updated/bdwgc/win32_threads.c
--- bdwgc/win32_threads.c	2008-11-22 15:03:44.000000000 +0300
+++ updated/bdwgc/win32_threads.c	2008-11-25 14:40:06.196587200 +0300
@@ -584,6 +584,10 @@
   /* Check GC is initialized and the current thread is registered. */
   GC_ASSERT(GC_lookup_thread_inner(GetCurrentThreadId()) != 0);
 
+# if defined(GC_DLL) && !defined(PARALLEL_MARK) && !defined(THREAD_LOCAL_ALLOC)
+    /* GC_init_parallel() is not called from GC_init_inner().	*/
+    parallel_initialized = TRUE;
+# endif
   GC_need_to_lock = TRUE; /* We are multi-threaded now. */
 }
 


More information about the Gc mailing list