diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-06 16:14:54 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-06 16:14:54 -0700 |
commit | 12f0a582fb28f5a7838aff00328d6729ea458670 (patch) | |
tree | 5132b95ebffd0680f0b8941ab89bbf6f174a9efb /src/core/lib/iomgr/ev_epollex_linux.c | |
parent | a74808604a03682108fc4a6d72384f1f5216849c (diff) |
Add global wakeup to pollset
Diffstat (limited to 'src/core/lib/iomgr/ev_epollex_linux.c')
-rw-r--r-- | src/core/lib/iomgr/ev_epollex_linux.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/ev_epollex_linux.c b/src/core/lib/iomgr/ev_epollex_linux.c index 839807c246..8d3e3bd562 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.c +++ b/src/core/lib/iomgr/ev_epollex_linux.c @@ -461,6 +461,13 @@ static void pollset_init(grpc_pollset *pollset, gpr_mu **mu) { pollset->epfd = epoll_create1(EPOLL_CLOEXEC); if (pollset->epfd < 0) { GRPC_LOG_IF_ERROR("pollset_init", GRPC_OS_ERROR(errno, "epoll_create1")); + } else { + struct epoll_event ev = {.events = EPOLLIN | EPOLLET | EPOLLEXCLUSIVE, + .data.ptr = &global_wakeup_fd}; + if (epoll_ctl(pollset->epfd, EPOLL_CTL_ADD, global_wakeup_fd.read_fd, + &ev) != 0) { + GRPC_LOG_IF_ERROR("pollset_init", GRPC_OS_ERROR(errno, "epoll_ctl")); + } } pollset->num_pollers = 0; gpr_atm_no_barrier_store(&pollset->shutdown_atm, 0); |