diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-20 19:24:57 +0000 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-20 19:24:57 +0000 |
commit | 59db187c853c32cdb031f6cc6af65f9df76c07ef (patch) | |
tree | df82946ada84d286dfa1cbacbeadfc82cf0a68f7 /src/cpp/server | |
parent | ae1e29eed96798cadfed15b2e1e63e92dcf6d36e (diff) | |
parent | c4c296e2d8ad6b90f5e36e4739ae3d68c66ace1f (diff) |
Merge branch 'tsan-c++' into hybrid
Diffstat (limited to 'src/cpp/server')
-rw-r--r-- | src/cpp/server/server_cc.cc | 2 | ||||
-rw-r--r-- | src/cpp/server/server_context.cc | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 423f347acd..b4d6961db8 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -607,7 +607,7 @@ void Server::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) { static const size_t MAX_OPS = 8; size_t nops = 0; grpc_op cops[MAX_OPS]; - ops->FillOps(cops, &nops); + ops->FillOps(call->call(), cops, &nops); auto result = grpc_call_start_batch(call->call(), cops, nops, ops, nullptr); GPR_ASSERT(GRPC_CALL_OK == result); } diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 33ad0ae142..923556413e 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -62,7 +62,7 @@ class ServerContext::CompletionOp final : public CallOpSetInterface { finalized_(false), cancelled_(0) {} - void FillOps(grpc_op* ops, size_t* nops) override; + void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) override; bool FinalizeResult(void** tag, bool* status) override; bool CheckCancelled(CompletionQueue* cq) { @@ -100,7 +100,8 @@ void ServerContext::CompletionOp::Unref() { } } -void ServerContext::CompletionOp::FillOps(grpc_op* ops, size_t* nops) { +void ServerContext::CompletionOp::FillOps(grpc_call* call, grpc_op* ops, + size_t* nops) { ops->op = GRPC_OP_RECV_CLOSE_ON_SERVER; ops->data.recv_close_on_server.cancelled = &cancelled_; ops->flags = 0; @@ -151,7 +152,7 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata_array* arr) ServerContext::~ServerContext() { if (call_) { - grpc_call_destroy(call_); + grpc_call_unref(call_); } if (completion_op_) { completion_op_->Unref(); |