summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-05-30 23:14:29 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-05-30 23:14:29 +0300
commit0c56f4381e52962cdad2ebfefe8aae280f5c95f6 (patch)
tree9196343f9bc3a65ae487fd557c0d309bb9228672 /win32_threads.c
parent009b59a84bad832f2750947c02a10f521ff50ba6 (diff)
downloadbdwgc-0c56f4381e52962cdad2ebfefe8aae280f5c95f6.tar.gz
Fix abort in Win32 DllMain if PARALLEL_MARK
(fix of commit f1b257a66) Also, enable GC_use_threads_discovery() on Windows even in case of PARALLEL_MARK. * tests/gctest.c [GC_WIN32_THREADS && !GC_PTHREADS && GC_DLL && !GC_NO_THREADS_DISCOVERY && !MSWINCE && !THREAD_LOCAL_ALLOC] (WinMain): Call GC_use_threads_discovery() regardless of PARALLEL_MARK. * win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY && PARALLEL_MARK] (GC_DllMain): Do not abort if DLL_PROCESS_ATTACH or DLL_THREAD_ATTACH (call GC_register_my_thread_inner instead).
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 75c8fcb4..ee9e7375 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -3163,9 +3163,6 @@ GC_INNER void GC_thr_init(void)
/* This may run with the collector uninitialized. */
thread_id = GetCurrentThreadId();
if (parallel_initialized && GC_main_thread != thread_id) {
-# ifdef PARALLEL_MARK
- ABORT("Cannot initialize parallel marker from DllMain");
-# else
struct GC_stack_base sb;
/* Don't lock here. */
# ifdef GC_ASSERTIONS
@@ -3174,7 +3171,6 @@ GC_INNER void GC_thr_init(void)
GC_get_stack_base(&sb);
GC_ASSERT(sb_result == GC_SUCCESS);
GC_register_my_thread_inner(&sb, thread_id);
-# endif
} /* o.w. we already did it during GC_thr_init, called by GC_init */
break;