summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorScott Ferguson <scott.ferguson@unity3d.com>2020-01-31 14:24:57 -0500
committerIvan Maidanski <ivmai@mail.ru>2021-09-17 13:28:55 +0300
commitb731a050b3c6b0f68cd7996b11df2306b37e0d8b (patch)
treef6953c1a5d99d5c92b376032c8939deaffb6ab46 /pthread_stop_world.c
parent293df2fae5254fdb5e38c0321a7444e10d31fa81 (diff)
downloadbdwgc-b731a050b3c6b0f68cd7996b11df2306b37e0d8b.tar.gz
Retry suspend/resume signals on all platforms by default
(a cherry-pick of commit 0db2dc3e3 from Unity-Technologies/bdwgc) Default GC_retry_signals=TRUE (unless NO_RETRY_SIGNALS macro is specified). We saw GC lockups because of lost signals on Android. Any platform could lose signals, so be conservative and always retry. Note: the retry policy still could be disabled at runtime by setting GC_RETRY_SIGNALS environment variable to "0". * pthread_stop_world.c [!NO_RETRY_SIGNALS] (GC_retry_signals): Initialize to true (regardless of GC_OSF1_THREADS,THREAD_SANITIZER, ADDRESS_SANITIZER, MEMORY_SANITIZER); add comment.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 41b8e990..ab3e97cd 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -128,8 +128,9 @@ STATIC volatile AO_t GC_world_is_stopped = FALSE;
/* before they are expected to stop (unless */
/* they have stopped voluntarily). */
-#if defined(GC_OSF1_THREADS) || defined(THREAD_SANITIZER) \
- || defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER)
+#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 GC_bool GC_retry_signals = FALSE;