]> granicus.if.org Git - gc/commitdiff
Remove erroneous GC_use_threads_discovery call from GC_DllMain
authorIvan Maidanski <ivmai@mail.ru>
Sun, 25 Nov 2012 09:42:04 +0000 (13:42 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 11 May 2015 15:59:02 +0000 (18:59 +0300)
* 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

win32_threads.c
windows-untested/vc9/libgc.vcproj

index 31d33b65c391882d4e347af7c9a5152bcadca5f9..a264e001ef37e9af48d4e1cf1413db4fe342522b 100644 (file)
@@ -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) {
index 195febfe293f2bab190b12a8921a12b1fb2b3d27..9e91f7b015536a06b4bd5515188b99306e00e29e 100644 (file)
@@ -43,7 +43,7 @@
             <Tool
                 Name="VCCLCompilerTool"
                 AdditionalIncludeDirectories="../../libatomic_ops/src/"
-                PreprocessorDefinitions="GC_BUILD"
+                PreprocessorDefinitions="GC_BUILD;GC_DISCOVER_TASK_THREADS"
                 UsePrecompiledHeader="0"
             />
             <Tool
             <Tool
                 Name="VCCLCompilerTool"
                 AdditionalIncludeDirectories="../../libatomic_ops/src/"
-                PreprocessorDefinitions="GC_BUILD"
+                PreprocessorDefinitions="GC_BUILD;GC_DISCOVER_TASK_THREADS"
                 UsePrecompiledHeader="0"
             />
             <Tool
             <Tool
                 Name="VCCLCompilerTool"
                 AdditionalIncludeDirectories="../../libatomic_ops/src/"
-                PreprocessorDefinitions="GC_BUILD"
+                PreprocessorDefinitions="GC_BUILD;GC_DISCOVER_TASK_THREADS"
                 UsePrecompiledHeader="0"
             />
             <Tool
             <Tool
                 Name="VCCLCompilerTool"
                 AdditionalIncludeDirectories="../../libatomic_ops/src/"
-                PreprocessorDefinitions="GC_BUILD"
+                PreprocessorDefinitions="GC_BUILD;GC_DISCOVER_TASK_THREADS"
                 UsePrecompiledHeader="0"
             />
             <Tool