From b31b2cc2cb0273388288d96f3fc21132b43ea2f6 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 9 Dec 2022 08:35:19 +0300 Subject: 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. --- win32_threads.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'win32_threads.c') 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); -- cgit v1.2.1