diff options
author | ncteisen <ncteisen@gmail.com> | 2017-11-17 16:16:06 -0800 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-11-17 16:17:21 -0800 |
commit | 0392f8acc33a89fe7d255e6cda0f96eb3a0ec6ab (patch) | |
tree | 51234a00cf528a1fdf8e73cad2cc459925b1673c /src/core/lib/surface/server.cc | |
parent | aa3b19741f345faa3eb3d9bdcfa9d7064e5c439c (diff) | |
parent | 90c8cf6acc698ddef1d2da3b205ad8d0014b52fa (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into tracing++
Diffstat (limited to 'src/core/lib/surface/server.cc')
-rw-r--r-- | src/core/lib/surface/server.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 39563a8bb3..57bb6cc18b 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -349,14 +349,8 @@ static void request_matcher_kill_requests(grpc_exec_ctx* exec_ctx, grpc_error* error) { requested_call* rc; for (size_t i = 0; i < server->cq_count; i++) { - /* Here we know: - 1. no requests are being added (since the server is shut down) - 2. no other threads are pulling (since the shut down process is single - threaded) - So, we can ignore the queue lock and just pop, with the guarantee that a - NULL returned here truly means that the queue is empty */ - while ((rc = (requested_call*)gpr_mpscq_pop( - &rm->requests_per_cq[i].queue)) != nullptr) { + while ((rc = (requested_call*)gpr_locked_mpscq_pop( + &rm->requests_per_cq[i])) != nullptr) { fail_call(exec_ctx, server, i, rc, GRPC_ERROR_REF(error)); } } |