aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2018-04-09 13:26:34 -0700
committerGravatar GitHub <noreply@github.com>2018-04-09 13:26:34 -0700
commit09386db3939cae1ac12e5f09b735adfa8958c68e (patch)
tree5d365f0ea4086d5c175fa74d2d74dfd17d939b1e /src/core/lib/iomgr
parent03f01fd9aee0e5dc918f324b3ac084468c6b630f (diff)
parent0c4c9d78b539ae7fcbfce2b4372811bb6b4a19d8 (diff)
Merge pull request #14959 from yashykt/pollcvfix
poll-cv Fix for zero timeout
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index 2e375b4022..d9aba9b6a3 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -1530,6 +1530,12 @@ static void run_poll(void* args) {
// This function overrides poll() to handle condition variable wakeup fds
static int cvfd_poll(struct pollfd* fds, nfds_t nfds, int timeout) {
+ if (timeout == 0) {
+ // Don't bother using background threads for polling if timeout is 0,
+ // poll-cv might not wait for a poll to return otherwise.
+ // https://github.com/grpc/grpc/issues/13298
+ return poll(fds, nfds, 0);
+ }
unsigned int i;
int res, idx;
grpc_cv_node* pollcv;