diff options
author | Sree Kuchibhotla <sreek@google.com> | 2016-04-07 18:32:44 -0700 |
---|---|---|
committer | Sree Kuchibhotla <sreek@google.com> | 2016-04-12 09:20:32 -0700 |
commit | 76cfc6ac97cd542f331aff60aaa273fccdaed815 (patch) | |
tree | dfa1104dcff5d10691799a8a38dd5db18b13069d /src/core/lib/iomgr | |
parent | c75787ba0fb29e2f27b7f41769c15c7fe9bc996e (diff) |
Some comments
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r-- | src/core/lib/iomgr/ev_poll_and_epoll_posix.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c index 3c8127e1a8..306d312dc4 100644 --- a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c +++ b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c @@ -756,9 +756,14 @@ static void pollset_kick_ext(grpc_pollset *p, specific_worker = pop_front_worker(p); if (specific_worker != NULL) { if (gpr_tls_get(&g_current_thread_worker) == (intptr_t)specific_worker) { + /* Prefer not to kick self. Push the worker to the end of the list and + * pop the one from front */ GPR_TIMER_MARK("kick_anonymous_not_self", 0); push_back_worker(p, specific_worker); specific_worker = pop_front_worker(p); + /* If there was only one worker on the pollset, we would get the same + * worker we pushed (the one set on current thread local) back. If so, + * kick it only if GRPC_POLLSET_CAN_KICK_SELF flag is set */ if ((flags & GRPC_POLLSET_CAN_KICK_SELF) == 0 && gpr_tls_get(&g_current_thread_worker) == (intptr_t)specific_worker) { |