summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-05-30 23:38:44 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-05-30 23:38:44 +0300
commitb8cb5a63e65e17c5adb9f4fcccd615200662ced8 (patch)
tree9dbaa713d38bc17249d1e9de181018188036473b /win32_threads.c
parent6bc265c7d5d0352eb69f7d375b62b1f5efd11dc0 (diff)
downloadbdwgc-b8cb5a63e65e17c5adb9f4fcccd615200662ced8.tar.gz
Refine comments in code regarding DllMain-based threads registration
* include/gc/gc.h (GC_use_threads_discovery): Refine comment (mention GC_register_my_thread and GC_init). * os_dep.c [MSWIN32 || MSWINCE] (GC_get_stack_base): Add comment about the GC lock. * win32_threads.c (GC_CreateThread): Add comment about GC_init_parallel if GC_win32_dll_threads set by GC_use_threads_discovery(). * win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY] (GC_DllMain): Add more comments for DLL_THREAD_ATTACH case.
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/win32_threads.c b/win32_threads.c
index ee9e7375..204f60b0 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -2580,8 +2580,9 @@ GC_INNER void GC_get_next_stack(char *start, char *limit,
if (!EXPECT(parallel_initialized, TRUE))
GC_init_parallel();
GC_ASSERT(GC_thr_initialized);
- /* Make sure GC is initialized (i.e. main thread is */
- /* attached, tls is initialized). */
+ /* Make sure GC is initialized (i.e. main thread is attached, */
+ /* tls is initialized). This is redundant when */
+ /* GC_win32_dll_threads is set by GC_use_threads_discovery(). */
# ifdef DEBUG_THREADS
GC_log_printf("About to create a thread from 0x%lx\n",
@@ -3150,11 +3151,12 @@ GC_INNER void GC_thr_init(void)
if (!GC_win32_dll_threads && parallel_initialized) return TRUE;
switch (reason) {
- case DLL_THREAD_ATTACH:
+ case DLL_THREAD_ATTACH: /* invoked for threads other than main */
# ifdef PARALLEL_MARK
/* Don't register marker threads. */
if (GC_parallel) {
/* We could reach here only if parallel_initialized == FALSE. */
+ /* Because GC_thr_init() sets GC_parallel to off. */
break;
}
# endif