summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-04-14 08:25:34 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-17 12:50:54 +0300
commit74f043e0f3ed647def2c7ef5699c2d1ac8845995 (patch)
tree55b7bf19677d388c4f7b6864cf54b9b02e69147e /pthread_stop_world.c
parent353babf906332cd47a76ba9a25a84137a66c4ca7 (diff)
downloadbdwgc-74f043e0f3ed647def2c7ef5699c2d1ac8845995.tar.gz
Eliminate code defect about GC_retry_signals update with the same value
(fix of commit 851cf18b8) * pthread_stop_world.c (GC_stop_init): Replace if-then-else statement with a conditional expression to set GC_retry_signals.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 1a229b52..9dd734a6 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -1387,12 +1387,8 @@ GC_INNER void GC_stop_init(void)
/* Override the default value of GC_retry_signals. */
str = GETENV("GC_RETRY_SIGNALS");
if (str != NULL) {
- if (*str == '0' && *(str + 1) == '\0') {
+ GC_retry_signals = *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(