Merge pull request #3362 from nicolasnoble/backport

Backport the lock race fix to 0.11.
pull/3409/head
Craig Tiller 9 years ago
commit d56c8bb052
  1. 12
      src/core/iomgr/pollset_posix.c

@ -187,6 +187,12 @@ void grpc_pollset_work(grpc_pollset *pollset, grpc_pollset_worker *worker,
if (pollset->shutting_down) {
goto done;
}
if (pollset->in_flight_cbs) {
/* Give do_promote priority so we don't starve it out */
gpr_mu_unlock(&pollset->mu);
gpr_mu_lock(&pollset->mu);
goto done;
}
if (!pollset->kicked_without_pollers) {
push_front_worker(pollset, worker);
added_worker = 1;
@ -422,12 +428,6 @@ static void basic_pollset_maybe_work(grpc_pollset *pollset,
int r;
int nfds;
if (pollset->in_flight_cbs) {
/* Give do_promote priority so we don't starve it out */
gpr_mu_unlock(&pollset->mu);
gpr_mu_lock(&pollset->mu);
return;
}
fd = pollset->data.ptr;
if (fd && grpc_fd_is_orphaned(fd)) {
GRPC_FD_UNREF(fd, "basicpoll");

Loading…
Cancel
Save