summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-04-02 22:45:41 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-03 11:08:23 +0300
commite2c93160805c2c434ee0bd79ce403674ba3f3dcd (patch)
tree842a94753b81d2ebc459631c8204ebe054350f84 /pthread_stop_world.c
parent1de798ab7b3040b589e7c3b91535a4cce76bee84 (diff)
downloadbdwgc-e2c93160805c2c434ee0bd79ce403674ba3f3dcd.tar.gz
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.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c15
1 files changed, 5 insertions, 10 deletions
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();