summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-12-09 08:35:19 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-12-09 16:36:07 +0300
commitb31b2cc2cb0273388288d96f3fc21132b43ea2f6 (patch)
treeffa66052dc55959ad172c600d39cdb3e26caeff8 /win32_threads.c
parentf77d0654663a345ee440ef775b7fb935c103ced5 (diff)
downloadbdwgc-b31b2cc2cb0273388288d96f3fc21132b43ea2f6.tar.gz
Fix 'GC_write called with write_disabled' assertion in GC_suspend
(fix of commit bc1866b14) Reproduced only if DEBUG_THREADS is defined. Do not call GC_log_printf(), even indirectly from GC_stop_world() with GC_write_cs acquired. * pthread_support.c [DEBUG_THREADS] (GC_delete_thread, GC_delete_gc_thread_no_free): Do not call GC_log_printf() if MSWINCE or MSWIN32 and not CONSOLE_LOG. * win32_threads.c [DEBUG_THREADS] (GC_suspend): Likewise.
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 4ff7c9cb..c60a2592 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -396,7 +396,8 @@ STATIC void GC_suspend(GC_thread t)
# endif
# endif
-# ifdef DEBUG_THREADS
+# if defined(DEBUG_THREADS) && !defined(MSWINCE) \
+ && (!defined(MSWIN32) || defined(CONSOLE_LOG))
GC_log_printf("Suspending 0x%x\n", (int)t->id);
# endif
GC_win32_unprotect_thread(t);