|
|
|
@ -205,7 +205,7 @@ struct grpc_pollset_worker { |
|
|
|
|
struct grpc_pollset { |
|
|
|
|
pollable pollable; |
|
|
|
|
pollable *current_pollable; |
|
|
|
|
int kick_alls_pending; |
|
|
|
|
int kick_alls_pending; |
|
|
|
|
bool kicked_without_poller; |
|
|
|
|
grpc_closure *shutdown_closure; |
|
|
|
|
grpc_pollset_worker *root_worker; |
|
|
|
@ -646,15 +646,17 @@ static void pollset_global_shutdown(void) { |
|
|
|
|
|
|
|
|
|
static void pollset_maybe_finish_shutdown(grpc_exec_ctx *exec_ctx, |
|
|
|
|
grpc_pollset *pollset) { |
|
|
|
|
if (pollset->shutdown_closure != NULL && pollset->root_worker == NULL && pollset->kick_alls_pending==0) { |
|
|
|
|
if (pollset->shutdown_closure != NULL && pollset->root_worker == NULL && |
|
|
|
|
pollset->kick_alls_pending == 0) { |
|
|
|
|
grpc_closure_sched(exec_ctx, pollset->shutdown_closure, GRPC_ERROR_NONE); |
|
|
|
|
pollset->shutdown_closure = NULL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void do_kick_all(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error_unused) { |
|
|
|
|
static void do_kick_all(grpc_exec_ctx *exec_ctx, void *arg, |
|
|
|
|
grpc_error *error_unused) { |
|
|
|
|
grpc_error *error = GRPC_ERROR_NONE; |
|
|
|
|
grpc_pollset *pollset = arg; |
|
|
|
|
grpc_pollset *pollset = arg; |
|
|
|
|
gpr_mu_lock(&pollset->pollable.po.mu); |
|
|
|
|
if (pollset->root_worker != NULL) { |
|
|
|
|
grpc_pollset_worker *worker = pollset->root_worker; |
|
|
|
@ -676,15 +678,17 @@ grpc_pollset *pollset = arg; |
|
|
|
|
worker = worker->links[PWL_POLLSET].next; |
|
|
|
|
} while (worker != pollset->root_worker); |
|
|
|
|
} |
|
|
|
|
pollset->kick_alls_pending--; |
|
|
|
|
pollset_maybe_finish_shutdown(exec_ctx, pollset); |
|
|
|
|
pollset->kick_alls_pending--; |
|
|
|
|
pollset_maybe_finish_shutdown(exec_ctx, pollset); |
|
|
|
|
gpr_mu_unlock(&pollset->pollable.po.mu); |
|
|
|
|
GRPC_LOG_IF_ERROR("kick_all", error); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void pollset_kick_all(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) { |
|
|
|
|
pollset->kick_alls_pending++; |
|
|
|
|
grpc_closure_sched(exec_ctx, grpc_closure_create(do_kick_all, pollset, grpc_schedule_on_exec_ctx), GRPC_ERROR_NONE); |
|
|
|
|
pollset->kick_alls_pending++; |
|
|
|
|
grpc_closure_sched(exec_ctx, grpc_closure_create(do_kick_all, pollset, |
|
|
|
|
grpc_schedule_on_exec_ctx), |
|
|
|
|
GRPC_ERROR_NONE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static grpc_error *pollset_kick_inner(grpc_pollset *pollset, pollable *p, |
|
|
|
|