aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-08-04 16:00:00 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-08-04 16:00:00 -0700
commit5f70fc60f5fbf766aae252a66f5cb447eb6efb0c (patch)
tree8825e00f4c5536bb48ea2938aa76b6d062e6348b /src/core
parent2f42fdef8e77c2a1e087384a24c135d8912af80a (diff)
Fixup compilation
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/iomgr/combiner.c13
-rw-r--r--src/core/lib/surface/completion_queue.c2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/combiner.c b/src/core/lib/iomgr/combiner.c
index eb5ad634bd..1042cd8659 100644
--- a/src/core/lib/iomgr/combiner.c
+++ b/src/core/lib/iomgr/combiner.c
@@ -171,10 +171,21 @@ static bool start_execute_final(grpc_exec_ctx *exec_ctx, grpc_combiner *lock) {
static bool maybe_finish_one(grpc_exec_ctx *exec_ctx, grpc_combiner *lock) {
GPR_TIMER_BEGIN("combiner.maybe_finish_one", 0);
+ GPR_ASSERT(exec_ctx->active_combiner == lock);
+ if (lock->optional_workqueue != NULL &&
+ grpc_exec_ctx_ready_to_finish(exec_ctx)) {
+ // this execution context wants to move on, and we have a workqueue (and so
+ // can help the execution context out): schedule remaining work to be picked
+ // up on the workqueue
+ grpc_closure_init(&lock->continue_finishing, continue_finishing_mainline,
+ lock);
+ grpc_workqueue_enqueue(exec_ctx, lock->optional_workqueue,
+ &lock->continue_finishing, GRPC_ERROR_NONE);
+ return false;
+ }
gpr_mpscq_node *n = gpr_mpscq_pop(&lock->queue);
GRPC_COMBINER_TRACE(
gpr_log(GPR_DEBUG, "C:%p maybe_finish_one n=%p", lock, n));
- GPR_ASSERT(exec_ctx->active_combiner == lock);
if (n == NULL) {
// queue is in an inconsistant state: use this as a cue that we should
// go off and do something else for a while (and come back later)
diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c
index 9eb4dfc618..47f53f7ad2 100644
--- a/src/core/lib/surface/completion_queue.c
+++ b/src/core/lib/surface/completion_queue.c
@@ -521,7 +521,7 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
for (;;) {
if (is_finished_arg.stolen_completion != NULL) {
gpr_mu_unlock(cc->mu);
- grpc_cq_completion *c = is_finished_arg.stolen_completion;
+ c = is_finished_arg.stolen_completion;
is_finished_arg.stolen_completion = NULL;
ret.type = GRPC_OP_COMPLETE;
ret.success = c->next & 1u;