aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-06-08 08:08:11 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-06-08 08:08:11 -0700
commit747216fcef5645cf99d4e366da4c2b75483f80bf (patch)
treebaeb1bc72e92ed9276dd34159e6f44c2b17e92d3 /src
parentb3899fd18bdb81867e78f6a2ce1bbd91eb4f37da (diff)
Review feedback
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/iomgr/combiner.c5
-rw-r--r--src/core/lib/iomgr/executor.c4
2 files changed, 3 insertions, 6 deletions
diff --git a/src/core/lib/iomgr/combiner.c b/src/core/lib/iomgr/combiner.c
index e958321719..f6976c5650 100644
--- a/src/core/lib/iomgr/combiner.c
+++ b/src/core/lib/iomgr/combiner.c
@@ -222,9 +222,8 @@ bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx *exec_ctx) {
if (contended && grpc_exec_ctx_ready_to_finish(exec_ctx) &&
grpc_executor_is_threaded()) {
GPR_TIMER_MARK("offload_from_finished_exec_ctx", 0);
- // 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
+ // this execution context wants to move on: schedule remaining work to be
+ // picked up on the executor
queue_offload(exec_ctx, lock);
GPR_TIMER_END("combiner.continue_exec_ctx", 0);
return true;
diff --git a/src/core/lib/iomgr/executor.c b/src/core/lib/iomgr/executor.c
index cac0606e48..c40aca3aa7 100644
--- a/src/core/lib/iomgr/executor.c
+++ b/src/core/lib/iomgr/executor.c
@@ -173,8 +173,8 @@ static void executor_push(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
ts->depth++;
bool try_new_thread = ts->depth > MAX_DEPTH &&
cur_thread_count < g_max_threads && !ts->shutdown;
+ gpr_mu_unlock(&ts->mu);
if (try_new_thread && gpr_spinlock_trylock(&g_adding_thread_lock)) {
- gpr_mu_unlock(&ts->mu);
cur_thread_count = (size_t)gpr_atm_no_barrier_load(&g_cur_threads);
if (cur_thread_count < g_max_threads) {
gpr_atm_no_barrier_store(&g_cur_threads, cur_thread_count + 1);
@@ -185,8 +185,6 @@ static void executor_push(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
&g_thread_state[cur_thread_count], &opt);
}
gpr_spinlock_unlock(&g_adding_thread_lock);
- } else {
- gpr_mu_unlock(&ts->mu);
}
}