Use gpr_atm_full_xchg() instead of acq_load and full_fetch_add().

pull/15436/head
Mark D. Roth 7 years ago
parent 290d35e1d2
commit f237ec4a93
  1. 3
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc

@ -64,8 +64,7 @@ void GrpcLbClientStats::AddCallDroppedLocked(char* token) {
namespace { namespace {
void AtomicGetAndResetCounter(int64_t* value, gpr_atm* counter) { void AtomicGetAndResetCounter(int64_t* value, gpr_atm* counter) {
*value = static_cast<int64_t>(gpr_atm_acq_load(counter)); *value = static_cast<int64_t>(gpr_atm_full_xchg(counter, (gpr_atm)0));
gpr_atm_full_fetch_add(counter, (gpr_atm)(-*value));
} }
} // namespace } // namespace

Loading…
Cancel
Save