diff options
author | David Garcia Quintas <dgq@google.com> | 2015-05-26 19:58:50 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-05-31 12:45:10 -0700 |
commit | 5f228f5001c7c1f85c0d1965640bd6258d7b9188 (patch) | |
tree | 15c767d330d3c302420ee4b45d6330f5693ffefa /src/core/channel/child_channel.c | |
parent | 2e378c89f89820941d1b30ad8c8b501fefa213b0 (diff) |
Adapted the following to the new iomgr's cb API:
alarm_test, tcp_posix, fd_posix, pollset_posix, credentials, call,
channel, server, child_channel
Diffstat (limited to 'src/core/channel/child_channel.c')
-rw-r--r-- | src/core/channel/child_channel.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/channel/child_channel.c b/src/core/channel/child_channel.c index a2f3c54290..5679a8c81a 100644 --- a/src/core/channel/child_channel.c +++ b/src/core/channel/child_channel.c @@ -58,6 +58,9 @@ typedef struct { gpr_uint8 sending_farewell; /* have we sent farewell (goaway + disconnect) */ gpr_uint8 sent_farewell; + + grpc_iomgr_closure finally_destroy_channel_iocb; + grpc_iomgr_closure send_farewells_iocb; } lb_channel_data; typedef struct { grpc_child_channel *channel; } lb_call_data; @@ -213,12 +216,18 @@ static void maybe_destroy_channel(grpc_child_channel *channel) { lb_channel_data *chand = LINK_BACK_ELEM_FROM_CHANNEL(channel)->channel_data; if (chand->destroyed && chand->disconnected && chand->active_calls == 0 && !chand->sending_farewell && !chand->calling_back) { - grpc_iomgr_add_callback(finally_destroy_channel, channel); + chand->finally_destroy_channel_iocb.cb = finally_destroy_channel; + chand->finally_destroy_channel_iocb.cb_arg = channel; + chand->finally_destroy_channel_iocb.is_ext_managed = 1; /* GPR_TRUE */ + grpc_iomgr_add_callback(&chand->finally_destroy_channel_iocb); } else if (chand->destroyed && !chand->disconnected && chand->active_calls == 0 && !chand->sending_farewell && !chand->sent_farewell) { chand->sending_farewell = 1; - grpc_iomgr_add_callback(send_farewells, channel); + chand->send_farewells_iocb.cb = send_farewells; + chand->send_farewells_iocb.cb_arg = channel; + chand->send_farewells_iocb.is_ext_managed = 1; /* GPR_TRUE */ + grpc_iomgr_add_callback(&chand->send_farewells_iocb); } } |