From 0c999523f35bae7739200f8d2a1d16cd8804eaac Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 15 Apr 2016 15:03:08 -0700 Subject: [PATCH] remove barrier --- src/core/lib/support/log.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/lib/support/log.c b/src/core/lib/support/log.c index cdcd3770455..5a47d2d3d5a 100644 --- a/src/core/lib/support/log.c +++ b/src/core/lib/support/log.c @@ -60,7 +60,7 @@ const char *gpr_log_severity_string(gpr_log_severity severity) { void gpr_log_message(const char *file, int line, gpr_log_severity severity, const char *message) { - if (severity < gpr_atm_acq_load(&g_min_severity_to_print)) return; + if (severity < gpr_atm_no_barrier_load(&g_min_severity_to_print)) return; gpr_log_func_args lfargs; memset(&lfargs, 0, sizeof(lfargs)); @@ -72,24 +72,26 @@ void gpr_log_message(const char *file, int line, gpr_log_severity severity, } void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print) { - gpr_atm_rel_store(&g_min_severity_to_print, (gpr_atm)min_severity_to_print); + gpr_atm_no_barrier_store(&g_min_severity_to_print, + (gpr_atm)min_severity_to_print); } void gpr_log_verbosity_init() { char *verbosity = gpr_getenv("GRPC_VERBOSITY"); if (verbosity == NULL) return; - gpr_log_severity min_severity_to_print = GPR_LOG_VERBOSITY_UNSET; + gpr_atm min_severity_to_print = GPR_LOG_VERBOSITY_UNSET; if (strcmp(verbosity, "DEBUG") == 0) { - min_severity_to_print = GPR_LOG_SEVERITY_DEBUG; + min_severity_to_print = (gpr_atm)GPR_LOG_SEVERITY_DEBUG; } else if (strcmp(verbosity, "INFO") == 0) { - min_severity_to_print = GPR_LOG_SEVERITY_INFO; + min_severity_to_print = (gpr_atm)GPR_LOG_SEVERITY_INFO; } else if (strcmp(verbosity, "ERROR") == 0) { - min_severity_to_print = GPR_LOG_SEVERITY_ERROR; + min_severity_to_print = (gpr_atm)GPR_LOG_SEVERITY_ERROR; } gpr_free(verbosity); - if ((gpr_atm_acq_load(&g_min_severity_to_print)) == GPR_LOG_VERBOSITY_UNSET) { - gpr_atm_rel_store(&g_min_severity_to_print, (gpr_atm)min_severity_to_print); + if ((gpr_atm_no_barrier_load(&g_min_severity_to_print)) == + GPR_LOG_VERBOSITY_UNSET) { + gpr_atm_no_barrier_store(&g_min_severity_to_print, min_severity_to_print); } }