review feedback

pull/30101/head
Craig Tiller 3 years ago
parent a5da837f2d
commit df5e9a578d
  1. 54
      src/core/lib/iomgr/ev_epoll1_linux.cc
  2. 7
      src/core/lib/iomgr/ev_poll_posix.cc
  3. 1
      src/core/lib/iomgr/ev_posix.cc

@ -1304,11 +1304,11 @@ const grpc_event_engine_vtable grpc_ev_epoll1_posix = {
pollset_set_del_fd,
is_any_background_poller_thread,
"epoll1",
[](bool) { return init_epoll1_linux(); },
[]() {},
/* name = */ "epoll1",
/* check_engine_available = */ [](bool) { return init_epoll1_linux(); },
/* init_engine = */ []() {},
shutdown_background_closure,
[]() {},
/* shutdown_engine = */ []() {},
add_closure_to_background_poller,
};
@ -1360,22 +1360,44 @@ static bool init_epoll1_linux() {
#if defined(GRPC_POSIX_SOCKET_EV_EPOLL1)
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
const grpc_event_engine_vtable grpc_ev_epoll1_posix = {
1, true, false,
1,
true,
false,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr, "epoll1", [](bool) { return false; },
nullptr, nullptr, nullptr,
nullptr,
/* name = */ "epoll1",
/* check_engine_available = */ [](bool) { return false; },
nullptr,
nullptr,
nullptr,
nullptr,
};
#endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLL1) */

@ -1394,7 +1394,8 @@ const grpc_event_engine_vtable grpc_ev_poll_posix = {
pollset_set_del_fd,
is_any_background_poller_thread,
"poll",
/* name = */ "poll",
/* check_engine_available = */
[](bool) {
if (!grpc_has_wakeup_fd()) {
gpr_log(GPR_ERROR, "Skipping poll because of no wakeup fd.");
@ -1411,8 +1412,8 @@ const grpc_event_engine_vtable grpc_ev_poll_posix = {
}
return true;
},
[]() {},
shutdown_background_closure,
/* init_engine = */ []() {},
/* shutdown_engine = */ shutdown_background_closure,
[]() {},
add_closure_to_background_poller,
};

@ -190,6 +190,7 @@ void grpc_register_event_engine_factory(const grpc_event_engine_vtable* vtable,
if (first_null == nullptr) first_null = &g_vtables[i];
last_null = &g_vtables[i];
} else if (0 == strcmp(g_vtables[i]->name, vtable->name)) {
g_vtables[i] = vtable;
return;
}
}

Loading…
Cancel
Save