summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-04-03 02:21:00 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-04-03 02:23:48 +0300
commite07dc277ddbd788230c7ef2acfdd3e3ed7f15aad (patch)
tree6cb869400b7c565550bc0275039ecce8330ec5e0 /pthread_stop_world.c
parent3498427481eb25ca885e64433e9b4bd198aa0368 (diff)
downloadbdwgc-e07dc277ddbd788230c7ef2acfdd3e3ed7f15aad.tar.gz
Replace GC_NO_RETRY_SIGNALS environment variable with GC_RETRY_SIGNALS=0
* doc/README.environment (GC_NO_RETRY_SIGNALS): Remove. * doc/README.environment (GC_RETRY_SIGNALS): Document "0" value. * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL] (GC_stop_init): Declare str local variable; do not check GC_NO_RETRY_SIGNALS environment variable; refine comment; set GC_retry_signals to false if the value of GC_RETRY_SIGNALS environment variable is "0".
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index b81274f2..b4c6a711 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -1140,6 +1140,7 @@ GC_INNER void GC_stop_init(void)
{
# if !defined(GC_OPENBSD_UTHREADS) && !defined(NACL)
struct sigaction act;
+ char *str;
if (SIGNAL_UNSET == GC_sig_suspend)
GC_sig_suspend = SIG_SUSPEND;
@@ -1195,12 +1196,15 @@ GC_INNER void GC_stop_init(void)
if (sigdelset(&suspend_handler_mask, GC_sig_thr_restart) != 0)
ABORT("sigdelset failed");
- /* Check for GC_RETRY_SIGNALS. */
- if (0 != GETENV("GC_RETRY_SIGNALS")) {
- GC_retry_signals = TRUE;
- }
- if (0 != GETENV("GC_NO_RETRY_SIGNALS")) {
- GC_retry_signals = FALSE;
+ /* Override the default value of GC_retry_signals. */
+ str = GETENV("GC_RETRY_SIGNALS");
+ if (str != NULL) {
+ if (*str == '0' && *(str + 1) == '\0') {
+ /* Do not retry if the environment variable is set to "0". */
+ GC_retry_signals = FALSE;
+ } else {
+ GC_retry_signals = TRUE;
+ }
}
if (GC_retry_signals) {
GC_COND_LOG_PRINTF(