diff options
author | 2016-02-25 13:55:13 -0800 | |
---|---|---|
committer | 2016-02-25 13:55:13 -0800 | |
commit | 85371a2bb09dc955c35e194efb461ee3d374c128 (patch) | |
tree | d21de62c259ff3499f61e85527effa77cdc442fb /test/core/end2end/fixtures | |
parent | 21679875659f382991f4c4e9e8bea34e93bc9b7f (diff) |
Change pollset mutex ownership
Diffstat (limited to 'test/core/end2end/fixtures')
-rw-r--r-- | test/core/end2end/fixtures/h2_uchannel.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/core/end2end/fixtures/h2_uchannel.c b/test/core/end2end/fixtures/h2_uchannel.c index f363b60cba..46b77a2326 100644 --- a/test/core/end2end/fixtures/h2_uchannel.c +++ b/test/core/end2end/fixtures/h2_uchannel.c @@ -253,8 +253,7 @@ static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *arg, bool success) { } static grpc_connected_subchannel *connect_subchannel(grpc_subchannel *c) { - gpr_mu mu; - gpr_mu_init(&mu); + gpr_mu *mu; grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_pollset_init(pollset, &mu); @@ -264,22 +263,21 @@ static grpc_connected_subchannel *connect_subchannel(grpc_subchannel *c) { &g_state, grpc_closure_create(state_changed, c)); grpc_exec_ctx_flush(&exec_ctx); - gpr_mu_lock(&mu); + gpr_mu_lock(mu); while (g_state != GRPC_CHANNEL_READY) { grpc_pollset_worker *worker = NULL; grpc_pollset_work(&exec_ctx, pollset, &worker, gpr_now(GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); - gpr_mu_unlock(&mu); + gpr_mu_unlock(mu); grpc_exec_ctx_flush(&exec_ctx); - gpr_mu_lock(&mu); + gpr_mu_lock(mu); } grpc_pollset_shutdown(&exec_ctx, pollset, grpc_closure_create(destroy_pollset, pollset)); grpc_pollset_set_destroy(&g_interested_parties); - gpr_mu_unlock(&mu); + gpr_mu_unlock(mu); grpc_exec_ctx_finish(&exec_ctx); gpr_free(pollset); - gpr_mu_destroy(&mu); return grpc_subchannel_get_connected_subchannel(c); } |