From d6887e0e4eaa68c10145cd2f730da8fb709a0588 Mon Sep 17 00:00:00 2001 From: Craig Tiller <ctiller@google.com> Date: Thu, 29 Dec 2016 10:11:40 -0800 Subject: [PATCH] Some fixes --- src/core/lib/iomgr/executor.c | 2 ++ src/core/lib/iomgr/tcp_client_posix.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/lib/iomgr/executor.c b/src/core/lib/iomgr/executor.c index 37a7142792..5f2a789e30 100644 --- a/src/core/lib/iomgr/executor.c +++ b/src/core/lib/iomgr/executor.c @@ -115,6 +115,8 @@ static void maybe_spawn_locked() { static void executor_push(grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_error *error) { gpr_mu_lock(&g_executor.mu); + GPR_ASSERT(closure->scheduler == grpc_executor_scheduler); + closure->scheduler = grpc_schedule_on_exec_ctx; if (g_executor.shutting_down == 0) { grpc_closure_list_append(&g_executor.closures, closure, error); maybe_spawn_locked(); diff --git a/src/core/lib/iomgr/tcp_client_posix.c b/src/core/lib/iomgr/tcp_client_posix.c index be7b695ad6..d089d2bc3b 100644 --- a/src/core/lib/iomgr/tcp_client_posix.c +++ b/src/core/lib/iomgr/tcp_client_posix.c @@ -342,8 +342,8 @@ static void tcp_client_connect_impl(grpc_exec_ctx *exec_ctx, addr_str = NULL; gpr_mu_init(&ac->mu); ac->refs = 2; - ac->write_closure.cb = on_writable; - ac->write_closure.cb_arg = ac; + grpc_closure_init(&ac->write_closure, on_writable, ac, + grpc_schedule_on_exec_ctx); ac->channel_args = grpc_channel_args_copy(channel_args); if (grpc_tcp_trace) { -- GitLab