Merge github.com:grpc/grpc into delayed-write

reviewable/pr6737/r3
Craig Tiller 9 years ago
commit ba61f4ac84
  1. 7
      src/core/lib/iomgr/tcp_server_posix.c

@ -134,7 +134,7 @@ struct grpc_tcp_server {
size_t pollset_count; size_t pollset_count;
/* next pollset to assign a channel to */ /* next pollset to assign a channel to */
size_t next_pollset_to_assign; gpr_atm next_pollset_to_assign;
}; };
static gpr_once check_init = GPR_ONCE_INIT; static gpr_once check_init = GPR_ONCE_INIT;
@ -181,7 +181,7 @@ grpc_error *grpc_tcp_server_create(grpc_closure *shutdown_complete,
s->head = NULL; s->head = NULL;
s->tail = NULL; s->tail = NULL;
s->nports = 0; s->nports = 0;
s->next_pollset_to_assign = 0; gpr_atm_no_barrier_store(&s->next_pollset_to_assign, 0);
*server = s; *server = s;
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }
@ -369,7 +369,8 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) {
} }
read_notifier_pollset = read_notifier_pollset =
sp->server->pollsets[(sp->server->next_pollset_to_assign++) % sp->server->pollsets[(size_t)gpr_atm_no_barrier_fetch_add(
&sp->server->next_pollset_to_assign, 1) %
sp->server->pollset_count]; sp->server->pollset_count];
/* loop until accept4 returns EAGAIN, and then re-arm notification */ /* loop until accept4 returns EAGAIN, and then re-arm notification */

Loading…
Cancel
Save