|
|
|
@ -447,7 +447,6 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, |
|
|
|
|
// Otherwise, we will receive epoll events after we release the FD.
|
|
|
|
|
epoll_event ev_fd; |
|
|
|
|
memset(&ev_fd, 0, sizeof(ev_fd)); |
|
|
|
|
if (release_fd != nullptr) { |
|
|
|
|
if (pollable_obj != nullptr) { // For PO_FD.
|
|
|
|
|
epoll_ctl(pollable_obj->epfd, EPOLL_CTL_DEL, fd->fd, &ev_fd); |
|
|
|
|
} |
|
|
|
@ -455,7 +454,6 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, |
|
|
|
|
const int epfd = fd->pollset_fds[i]; |
|
|
|
|
epoll_ctl(epfd, EPOLL_CTL_DEL, fd->fd, &ev_fd); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*release_fd = fd->fd; |
|
|
|
|
} else { |
|
|
|
|
close(fd->fd); |
|
|
|
@ -1295,7 +1293,7 @@ static grpc_error* pollset_as_multipollable_locked(grpc_pollset* pollset, |
|
|
|
|
static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) { |
|
|
|
|
GPR_TIMER_SCOPE("pollset_add_fd", 0); |
|
|
|
|
|
|
|
|
|
// We never transition from PO_MULTI to other modes (i.e., PO_FD or PO_EMOPTY)
|
|
|
|
|
// We never transition from PO_MULTI to other modes (i.e., PO_FD or PO_EMPTY)
|
|
|
|
|
// and, thus, it is safe to simply store and check whether the FD has already
|
|
|
|
|
// been added to the active pollable previously.
|
|
|
|
|
if (gpr_atm_acq_load(&pollset->active_pollable_type) == PO_MULTI && |
|
|
|
|