From f237ec4a93288260bca755f622909e2c94fcc6fa Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 18 May 2018 12:09:57 -0700 Subject: [PATCH] Use gpr_atm_full_xchg() instead of acq_load and full_fetch_add(). --- .../client_channel/lb_policy/grpclb/grpclb_client_stats.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc index 6724de71cb9..087cd8f276e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc @@ -64,8 +64,7 @@ void GrpcLbClientStats::AddCallDroppedLocked(char* token) { namespace { void AtomicGetAndResetCounter(int64_t* value, gpr_atm* counter) { - *value = static_cast(gpr_atm_acq_load(counter)); - gpr_atm_full_fetch_add(counter, (gpr_atm)(-*value)); + *value = static_cast(gpr_atm_full_xchg(counter, (gpr_atm)0)); } } // namespace