aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-04-10 13:52:53 -0700
committerGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-04-10 13:52:53 -0700
commite8a0b409c84ee9fd6c3f098691220c4f26367cb4 (patch)
tree0091687d2237e2de0018dfcd9408daaed52db4e3 /src/core
parent92cd367b99ca6ef5982775396aa9d5143eaa5d34 (diff)
parenta13752d8fde9b6b6bc00fc02a98c41b39fce0e3c (diff)
Merge pull request #1016 from dklempner/no_kick_self
Remove the current poller from the watch list to avoid immediately kicki...
Diffstat (limited to 'src/core')
-rw-r--r--src/core/iomgr/pollset_multipoller_with_poll_posix.c4
-rw-r--r--src/core/iomgr/pollset_posix.c4
2 files changed, 6 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 7570ff18c5..bcef7c35b5 100644
--- a/src/core/iomgr/pollset_multipoller_with_poll_posix.c
+++ b/src/core/iomgr/pollset_multipoller_with_poll_posix.c
@@ -172,6 +172,9 @@ static int multipoll_with_poll_pollset_maybe_work(
}
r = poll(h->pfds, h->pfd_count, timeout);
+
+ end_polling(pollset);
+
if (r < 0) {
if (errno != EINTR) {
gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno));
@@ -192,7 +195,6 @@ static int multipoll_with_poll_pollset_maybe_work(
}
}
grpc_pollset_kick_post_poll(&pollset->kick_state);
- end_polling(pollset);
gpr_mu_lock(&pollset->mu);
pollset->counter = 0;
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index 0bb722e2b1..03fd94f136 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -396,6 +396,9 @@ static int unary_poll_pollset_maybe_work(grpc_pollset *pollset,
pfd[1].events = grpc_fd_begin_poll(fd, pollset, POLLIN, POLLOUT, &fd_watcher);
r = poll(pfd, GPR_ARRAY_SIZE(pfd), timeout);
+
+ grpc_fd_end_poll(&fd_watcher);
+
if (r < 0) {
if (errno != EINTR) {
gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno));
@@ -415,7 +418,6 @@ static int unary_poll_pollset_maybe_work(grpc_pollset *pollset,
}
grpc_pollset_kick_post_poll(&pollset->kick_state);
- grpc_fd_end_poll(&fd_watcher);
gpr_mu_lock(&pollset->mu);
pollset->counter = 0;