aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/channel/client_channel.c
diff options
context:
space:
mode:
authorGravatar ctiller <ctiller@google.com>2015-01-07 12:13:17 -0800
committerGravatar Nicolas Noble <nnoble@google.com>2015-01-09 17:23:18 -0800
commite4b409364e4c493a66d4b2a6fe897075aa5c174e (patch)
tree29467626f50aea49e072e15004dd141625146709 /src/core/channel/client_channel.c
parent8232204a36712553b9eedb2dacab13b7c38642c6 (diff)
Add a --forever flag, to continuously run tests as things change.
Change on 2015/01/07 by ctiller <ctiller@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=83451760
Diffstat (limited to 'src/core/channel/client_channel.c')
-rw-r--r--src/core/channel/client_channel.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c
index 46283835a0..fd883a08ca 100644
--- a/src/core/channel/client_channel.c
+++ b/src/core/channel/client_channel.c
@@ -294,6 +294,14 @@ static void call_op(grpc_call_element *elem, grpc_call_element *from_elem,
}
}
+static void finally_destroy_channel(void *arg, grpc_iomgr_cb_status status) {
+ grpc_child_channel_destroy(arg);
+}
+
+static void destroy_channel_later(grpc_child_channel *channel) {
+ grpc_iomgr_add_callback(finally_destroy_channel, channel);
+}
+
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
channel_data *chand = elem->channel_data;
@@ -309,7 +317,7 @@ static void channel_op(grpc_channel_element *elem,
gpr_mu_unlock(&chand->mu);
if (child_channel) {
grpc_child_channel_handle_op(child_channel, op);
- grpc_child_channel_destroy(child_channel, 1);
+ destroy_channel_later(child_channel);
} else {
gpr_slice_unref(op->data.goaway.message);
}
@@ -321,7 +329,7 @@ static void channel_op(grpc_channel_element *elem,
chand->active_child = NULL;
gpr_mu_unlock(&chand->mu);
if (child_channel) {
- grpc_child_channel_destroy(child_channel, 1);
+ destroy_channel_later(child_channel);
}
break;
case GRPC_TRANSPORT_GOAWAY:
@@ -336,7 +344,7 @@ static void channel_op(grpc_channel_element *elem,
}
gpr_mu_unlock(&chand->mu);
if (child_channel) {
- grpc_child_channel_destroy(child_channel, 0);
+ destroy_channel_later(child_channel);
}
gpr_slice_unref(op->data.goaway.message);
break;
@@ -352,7 +360,7 @@ static void channel_op(grpc_channel_element *elem,
}
gpr_mu_unlock(&chand->mu);
if (child_channel) {
- grpc_child_channel_destroy(child_channel, 0);
+ destroy_channel_later(child_channel);
}
break;
default:
@@ -437,7 +445,7 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
grpc_transport_setup_cancel(chand->transport_setup);
if (chand->active_child) {
- grpc_child_channel_destroy(chand->active_child, 1);
+ grpc_child_channel_destroy(chand->active_child);
chand->active_child = NULL;
}
@@ -541,7 +549,7 @@ grpc_transport_setup_result grpc_client_channel_transport_setup_complete(
gpr_free(child_filters);
if (old_active) {
- grpc_child_channel_destroy(old_active, 1);
+ grpc_child_channel_destroy(old_active);
}
return result;