diff options
author | Craig Tiller <ctiller@google.com> | 2017-06-02 23:04:37 +0000 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-06-02 23:04:37 +0000 |
commit | cdb41dc0f3e72f955a00a677162af3952af04d83 (patch) | |
tree | 61c7e92fa3c3f46f56098d321ede27ec60a96a96 /src/core/lib/support | |
parent | 2a505cbe633b30afd7b10d655e000617b4a4ede9 (diff) |
Fixes
Diffstat (limited to 'src/core/lib/support')
-rw-r--r-- | src/core/lib/support/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/lib/support/log.c b/src/core/lib/support/log.c index af1651dae5..4d15553768 100644 --- a/src/core/lib/support/log.c +++ b/src/core/lib/support/log.c @@ -43,7 +43,7 @@ #include <string.h> extern void gpr_default_log(gpr_log_func_args *args); -static gpr_log_func g_log_func = gpr_default_log; +static gpr_atm g_log_func = (gpr_atm)gpr_default_log; static gpr_atm g_min_severity_to_print = GPR_LOG_VERBOSITY_UNSET; const char *gpr_log_severity_string(gpr_log_severity severity) { @@ -70,7 +70,7 @@ void gpr_log_message(const char *file, int line, gpr_log_severity severity, lfargs.line = line; lfargs.severity = severity; lfargs.message = message; - g_log_func(&lfargs); + ((gpr_log_func)gpr_atm_no_barrier_load(&g_log_func))(&lfargs); } void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print) { @@ -99,5 +99,5 @@ void gpr_log_verbosity_init() { } void gpr_set_log_function(gpr_log_func f) { - g_log_func = f ? f : gpr_default_log; + gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)(f ? f : gpr_default_log)); } |