aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/support/sync_posix.c
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2017-02-22 11:56:52 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2017-02-22 11:56:52 -0800
commit1392496e7f861fa03ed6edfcb1687a3b233b9b30 (patch)
treea23f989be296c2b322f80aea626c22520e3ce0ee /src/core/lib/support/sync_posix.c
parentff4b25d802845d3237e3890db240f3059d0ff784 (diff)
parent81f81c26f6c309eb6e8f7ce499f8ad9f9de40609 (diff)
Merge branch 'master' into fd_rw_atm_closure
Diffstat (limited to 'src/core/lib/support/sync_posix.c')
-rw-r--r--src/core/lib/support/sync_posix.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/lib/support/sync_posix.c b/src/core/lib/support/sync_posix.c
index de0f0484b5..16e7d6e12a 100644
--- a/src/core/lib/support/sync_posix.c
+++ b/src/core/lib/support/sync_posix.c
@@ -42,8 +42,10 @@
#include <time.h>
#include "src/core/lib/profiling/timers.h"
-#ifdef GPR_MU_COUNTERS
-gpr_atm grpc_mu_locks = 0;
+#ifdef GPR_LOW_LEVEL_COUNTERS
+gpr_atm gpr_mu_locks = 0;
+gpr_atm gpr_counter_atm_cas = 0;
+gpr_atm gpr_counter_atm_add = 0;
#endif
void gpr_mu_init(gpr_mu* mu) { GPR_ASSERT(pthread_mutex_init(mu, NULL) == 0); }
@@ -51,8 +53,8 @@ void gpr_mu_init(gpr_mu* mu) { GPR_ASSERT(pthread_mutex_init(mu, NULL) == 0); }
void gpr_mu_destroy(gpr_mu* mu) { GPR_ASSERT(pthread_mutex_destroy(mu) == 0); }
void gpr_mu_lock(gpr_mu* mu) {
-#ifdef GPR_MU_COUNTERS
- gpr_atm_no_barrier_fetch_add(&grpc_mu_locks, 1);
+#ifdef GPR_LOW_LEVEL_COUNTERS
+ GPR_ATM_INC_COUNTER(gpr_mu_locks);
#endif
GPR_TIMER_BEGIN("gpr_mu_lock", 0);
GPR_ASSERT(pthread_mutex_lock(mu) == 0);