From: Ivan Maidanski Date: Sun, 25 Nov 2012 09:42:04 +0000 (+0400) Subject: Remove erroneous GC_use_threads_discovery call from GC_DllMain X-Git-Tag: gc7_6_0~199^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3ec1cc80245f727fec0ecab53e8719c7a9960f2;p=gc Remove erroneous GC_use_threads_discovery call from GC_DllMain * win32_threads.c (GC_use_threads_discovery): Uncomment assertion; update comment. * win32_threads.c (GC_DllMain): Remove erroneous GC_use_threads_discovery call; add comment. * windows-untested/vc9/libgc.vcproj (PreprocessorDefinitions): Add GC_DISCOVER_TASK_THREADS (due to removal of GC_use_threads_discovery from GC_DllMain). Conflicts: win32_threads.c --- diff --git a/win32_threads.c b/win32_threads.c index 31d33b65..a264e001 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -158,6 +158,8 @@ GC_API void GC_CALL GC_use_threads_discovery(void) # else /* Turn on GC_win32_dll_threads. */ GC_ASSERT(!parallel_initialized); + /* Note that GC_use_threads_discovery is expected to be called by */ + /* the client application (not from DllMain) at start-up. */ # ifndef GC_DISCOVER_TASK_THREADS GC_win32_dll_threads = TRUE; # endif @@ -2674,6 +2676,11 @@ GC_INNER void GC_thr_init(void) DWORD thread_id; static int entry_count = 0; + /* Note that GC_use_threads_discovery should be called by the */ + /* client application at start-up to activate automatic thread */ + /* registration (it is the default GC behavior since v7.0alpha7); */ + /* to always have automatic thread registration turned on, the GC */ + /* should be compiled with -D GC_DISCOVER_TASK_THREADS. */ if (!GC_win32_dll_threads && parallel_initialized) return TRUE; switch (reason) { diff --git a/windows-untested/vc9/libgc.vcproj b/windows-untested/vc9/libgc.vcproj index 195febfe..9e91f7b0 100644 --- a/windows-untested/vc9/libgc.vcproj +++ b/windows-untested/vc9/libgc.vcproj @@ -43,7 +43,7 @@