aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/common/channel_arguments.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-12-05 21:19:52 -0800
committerGravatar GitHub <noreply@github.com>2017-12-05 21:19:52 -0800
commita3df36cc2505a89c2f481eea4a66a87b3002844a (patch)
tree72385cc865094115bc08cb813201d48cb09840bb /src/cpp/common/channel_arguments.cc
parent9dbb6e3a28ae9c5ed3c97913c4c363b15eb7b2cc (diff)
parent73bb67d054ecb952f10649cc42c998ab7ea8facd (diff)
Merge pull request #13058 from yashykt/execctx
All instances of exec_ctx being passed around in src/core removed
Diffstat (limited to 'src/cpp/common/channel_arguments.cc')
-rw-r--r--src/cpp/common/channel_arguments.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cpp/common/channel_arguments.cc b/src/cpp/common/channel_arguments.cc
index cae9ef953a..b696774243 100644
--- a/src/cpp/common/channel_arguments.cc
+++ b/src/cpp/common/channel_arguments.cc
@@ -66,13 +66,12 @@ ChannelArguments::ChannelArguments(const ChannelArguments& other)
}
ChannelArguments::~ChannelArguments() {
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_core::ExecCtx exec_ctx;
for (auto it = args_.begin(); it != args_.end(); ++it) {
if (it->type == GRPC_ARG_POINTER) {
- it->value.pointer.vtable->destroy(&exec_ctx, it->value.pointer.p);
+ it->value.pointer.vtable->destroy(it->value.pointer.p);
}
}
- grpc_exec_ctx_finish(&exec_ctx);
}
void ChannelArguments::Swap(ChannelArguments& other) {
@@ -95,17 +94,17 @@ void ChannelArguments::SetSocketMutator(grpc_socket_mutator* mutator) {
}
grpc_arg mutator_arg = grpc_socket_mutator_to_arg(mutator);
bool replaced = false;
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_core::ExecCtx exec_ctx;
for (auto it = args_.begin(); it != args_.end(); ++it) {
if (it->type == mutator_arg.type &&
grpc::string(it->key) == grpc::string(mutator_arg.key)) {
GPR_ASSERT(!replaced);
- it->value.pointer.vtable->destroy(&exec_ctx, it->value.pointer.p);
+ it->value.pointer.vtable->destroy(it->value.pointer.p);
it->value.pointer = mutator_arg.value.pointer;
replaced = true;
}
}
- grpc_exec_ctx_finish(&exec_ctx);
+
if (!replaced) {
args_.push_back(mutator_arg);
}