From e2c93160805c2c434ee0bd79ce403674ba3f3dcd Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 2 Apr 2022 22:45:41 +0300 Subject: Revert "Avoid hang in usleep during signals resend in child if TSan" This reverts commit ba0616b09bd3354ea9f27ec1ffc1480adbab78b8. Issue #236 (bdwgc). Because threads creation in the child process is not supported properly by ThreadSanitizer anyway. --- pthread_stop_world.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'pthread_stop_world.c') diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 75ca3d8e..7ce626b4 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -142,12 +142,13 @@ STATIC volatile AO_t GC_stop_count; /* before they are expected to stop (unless */ /* they have stopped voluntarily). */ -#if defined(CAN_HANDLE_FORK) && defined(THREAD_SANITIZER) - GC_INNER +#ifndef NO_RETRY_SIGNALS + /* Any platform could lose signals, so let's be conservative and */ + /* always enable signals retry logic. */ + STATIC GC_bool GC_retry_signals = TRUE; #else - STATIC + STATIC GC_bool GC_retry_signals = FALSE; #endif - GC_bool GC_retry_signals = FALSE; /* * We use signals to stop threads during GC. @@ -1403,11 +1404,6 @@ GC_INNER void GC_stop_init(void) if (sigdelset(&suspend_handler_mask, GC_sig_thr_restart) != 0) ABORT("sigdelset failed"); -# ifndef NO_RETRY_SIGNALS - /* Any platform could lose signals, so let's be conservative and */ - /* always enable signals retry logic. */ - GC_retry_signals = TRUE; -# endif /* Override the default value of GC_retry_signals. */ str = GETENV("GC_RETRY_SIGNALS"); if (str != NULL) { @@ -1422,7 +1418,6 @@ GC_INNER void GC_stop_init(void) GC_COND_LOG_PRINTF( "Will retry suspend and restart signals if necessary\n"); } - # ifndef NO_SIGNALS_UNBLOCK_IN_MAIN /* Explicitly unblock the signals once before new threads creation. */ GC_unblock_gc_signals(); -- cgit v1.2.1