From: Ivan Maidanski Date: Thu, 22 Mar 2018 08:24:04 +0000 (+0300) Subject: Fix assertion violation in DllMain of win32_threads X-Git-Tag: v8.0.0~279 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4480403f2545c4a1c0acda451f109d6e5e4629ec;p=gc Fix assertion violation in DllMain of win32_threads 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. --- diff --git a/win32_threads.c b/win32_threads.c index ccf44c96..58845e25 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -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. */