diff options
Diffstat (limited to 'src/core/iomgr/pollset_multipoller_with_poll_posix.c')
-rw-r--r-- | src/core/iomgr/pollset_multipoller_with_poll_posix.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/iomgr/pollset_multipoller_with_poll_posix.c b/src/core/iomgr/pollset_multipoller_with_poll_posix.c index e482da94f7..7c9a9491cb 100644 --- a/src/core/iomgr/pollset_multipoller_with_poll_posix.c +++ b/src/core/iomgr/pollset_multipoller_with_poll_posix.c @@ -131,7 +131,11 @@ static int multipoll_with_poll_pollset_maybe_work( } nf = 0; np = 1; - h->pfds[0].fd = grpc_kick_read_fd(pollset); + h->pfds[0].fd = grpc_pollset_kick_pre_poll(&pollset->kick_state); + if (h->pfds[0].fd < 0) { + /* Already kicked */ + return 1; + } h->pfds[0].events = POLLIN; h->pfds[0].revents = POLLOUT; for (i = 0; i < h->fd_count; i++) { @@ -173,7 +177,7 @@ static int multipoll_with_poll_pollset_maybe_work( /* do nothing */ } else { if (h->pfds[0].revents & POLLIN) { - grpc_kick_drain(pollset); + grpc_pollset_kick_consume(&pollset->kick_state); } for (i = 1; i < np; i++) { if (h->pfds[i].revents & POLLIN) { @@ -184,6 +188,7 @@ static int multipoll_with_poll_pollset_maybe_work( } } } + grpc_pollset_kick_post_poll(&pollset->kick_state); end_polling(pollset); gpr_mu_lock(&pollset->mu); |