aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib
diff options
context:
space:
mode:
authorGravatar yihuaz <yihuaz@google.com>2018-11-13 09:23:59 -0800
committerGravatar GitHub <noreply@github.com>2018-11-13 09:23:59 -0800
commitea56b5f61e9fa8b03236f3f3a463603685b1e807 (patch)
tree9ba17f53f1a67298cf8d96a3270ff02b73221529 /src/core/lib
parentf50811442116df92e9af3c77e786401eee7d5c06 (diff)
parent99d8216d065bfe9860589d0d71c78214229317a9 (diff)
Merge pull request #17148 from yihuazhang/test_branch
Resolve a deadlock caused by invocation of grpc_call_cancel inside of gRPC core
Diffstat (limited to 'src/core/lib')
-rw-r--r--src/core/lib/surface/call.cc4
-rw-r--r--src/core/lib/surface/call.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index 735a78ad08..89b3f77822 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -694,6 +694,10 @@ static void cancel_with_error(grpc_call* c, grpc_error* error) {
execute_batch(c, op, &state->start_batch);
}
+void grpc_call_cancel_internal(grpc_call* call) {
+ cancel_with_error(call, GRPC_ERROR_CANCELLED);
+}
+
static grpc_error* error_from_status(grpc_status_code status,
const char* description) {
// copying 'description' is needed to ensure the grpc_call_cancel_with_status
diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h
index b34260505a..bd7295fe11 100644
--- a/src/core/lib/surface/call.h
+++ b/src/core/lib/surface/call.h
@@ -81,6 +81,10 @@ grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
size_t nops,
grpc_closure* closure);
+/* gRPC core internal version of grpc_call_cancel that does not create
+ * exec_ctx. */
+void grpc_call_cancel_internal(grpc_call* call);
+
/* Given the top call_element, get the call object. */
grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element);