aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2015-04-02 14:34:27 -0700
committerGravatar Vijay Pai <vpai@google.com>2015-04-02 14:34:27 -0700
commit7d3d9ca24c3079030b2d57c1548a9d1d32b4829b (patch)
tree3e6d72857584e081ea2b4ff461458b633fa3eb3b /src
parentdc7110fdc581b49662e0a640da717e683c547b5a (diff)
Eliminate a redundant unlock-lock pair since this code is only invoked from
one place
Diffstat (limited to 'src')
-rw-r--r--src/core/transport/metadata.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/transport/metadata.c b/src/core/transport/metadata.c
index 1c15716fad..066cc263a1 100644
--- a/src/core/transport/metadata.c
+++ b/src/core/transport/metadata.c
@@ -97,7 +97,7 @@ static void internal_string_ref(internal_string *s);
static void internal_string_unref(internal_string *s);
static void discard_metadata(grpc_mdctx *ctx);
static void gc_mdtab(grpc_mdctx *ctx);
-static void metadata_context_destroy(grpc_mdctx *ctx);
+static void metadata_context_destroy_locked(grpc_mdctx *ctx);
static void lock(grpc_mdctx *ctx) { gpr_mu_lock(&ctx->mu); }
@@ -122,8 +122,7 @@ static void unlock(grpc_mdctx *ctx) {
discard_metadata(ctx);
}
if (ctx->strtab_count == 0) {
- gpr_mu_unlock(&ctx->mu);
- metadata_context_destroy(ctx);
+ metadata_context_destroy_locked(ctx);
return;
}
}
@@ -185,8 +184,7 @@ static void discard_metadata(grpc_mdctx *ctx) {
}
}
-static void metadata_context_destroy(grpc_mdctx *ctx) {
- gpr_mu_lock(&ctx->mu);
+static void metadata_context_destroy_locked(grpc_mdctx *ctx) {
GPR_ASSERT(ctx->strtab_count == 0);
GPR_ASSERT(ctx->mdtab_count == 0);
GPR_ASSERT(ctx->mdtab_free == 0);