]> granicus.if.org Git - gc/commitdiff
Fix assertion violation in DllMain of win32_threads
authorIvan Maidanski <ivmai@mail.ru>
Thu, 22 Mar 2018 08:24:04 +0000 (11:24 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 22 Mar 2018 08:24:04 +0000 (11:24 +0300)
DllMain(DLL_THREAD_ATTACH) might be called for C runtime threads
before main() is launched, so this commit just removes wrong
assertion in DllMain.

* win32_threads.c [!GC_NO_THREADS_DISCOVERY] (GC_DllMain): Remove
entry_count static variable; remove assertion for entry_count and
parallel_initialized values in DLL_THREAD_ATTACH case.

win32_threads.c

index ccf44c969fb2ca00ad7b328d3deae931c92e86aa..58845e25db65c88cb8afafa16419b810f14ab7e8 100644 (file)
@@ -2759,7 +2759,6 @@ GC_INNER void GC_thr_init(void)
                          LPVOID reserved GC_ATTR_UNUSED)
   {
       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    */
@@ -2777,8 +2776,6 @@ GC_INNER void GC_thr_init(void)
             break;
           }
 #       endif
-        GC_ASSERT(entry_count == 0 || parallel_initialized);
-        ++entry_count;
         /* FALLTHRU */
        case DLL_PROCESS_ATTACH:
         /* This may run with the collector uninitialized. */