aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2017-07-18 23:49:49 -0700
committerGravatar Sree Kuchibhotla <sreek@google.com>2017-07-18 23:49:49 -0700
commita0616efadf830db1b861bd96afbac8a47dad26c5 (patch)
tree94397e2e3e6e5af61ee778872ba7b711d9fb8c0d /src/core/lib/iomgr
parente6506bc9b2cf32351587e90dca72aa18640615d6 (diff)
Consume kicked_without_poller
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.c b/src/core/lib/iomgr/ev_epoll1_linux.c
index bd7c955d03..77d59059d4 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.c
+++ b/src/core/lib/iomgr/ev_epoll1_linux.c
@@ -630,17 +630,20 @@ static bool begin_worker(grpc_pollset *pollset, grpc_pollset_worker *worker,
}
/* We release pollset lock in this function at a couple of places:
- * 1. Brielfly when assigning pollset to a neighbourhood
+ * 1. Briefly when assigning pollset to a neighbourhood
* 2. When doing gpr_cv_wait()
* It is possible that 'kicked_without_poller' was set to true during (1) and
* 'shutting_down' is set to true during (1) or (2). If either of them is
* true, this worker cannot do polling */
-
/* TODO(sreek): Perhaps there is a better way to handle kicked_without_poller
* case; especially when the worker is the DESIGNATED_POLLER */
- return worker->kick_state == DESIGNATED_POLLER && !pollset->shutting_down &&
- !pollset->kicked_without_poller;
+ if (pollset->kicked_without_poller) {
+ pollset->kicked_without_poller = false;
+ return false;
+ }
+
+ return worker->kick_state == DESIGNATED_POLLER && !pollset->shutting_down;
}
static bool check_neighbourhood_for_available_poller(