diff options
author | Yash Tibrewal <yashkt@google.com> | 2018-04-02 18:32:06 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2018-04-20 14:55:07 -0700 |
commit | adc733f0249eaaabfed5ae9949af1ac416969cef (patch) | |
tree | d3b2f5403538c6048c637609277951d5a9e005ae /src/core/lib/iomgr/ev_poll_posix.cc | |
parent | 6f3cadb687f7d9e3da3d49b18c3f68463352db6b (diff) |
Make linux polling engines capable of tracking errors separately with
backward compatibility.
Diffstat (limited to 'src/core/lib/iomgr/ev_poll_posix.cc')
-rw-r--r-- | src/core/lib/iomgr/ev_poll_posix.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index d9aba9b6a3..670cde37a1 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -330,7 +330,8 @@ static void unref_by(grpc_fd* fd, int n) { } } -static grpc_fd* fd_create(int fd, const char* name) { +static grpc_fd* fd_create(int fd, const char* name, bool track_err) { + GPR_DEBUG_ASSERT(track_err == false); grpc_fd* r = static_cast<grpc_fd*>(gpr_malloc(sizeof(*r))); gpr_mu_init(&r->mu); gpr_atm_rel_store(&r->refst, 1); @@ -553,6 +554,11 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) { gpr_mu_unlock(&fd->mu); } +static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) { + gpr_log(GPR_ERROR, "Polling engine does not support tracking errors."); + abort(); +} + static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset, grpc_pollset_worker* worker, uint32_t read_mask, uint32_t write_mask, grpc_fd_watcher* watcher) { @@ -1710,6 +1716,7 @@ static void shutdown_engine(void) { static const grpc_event_engine_vtable vtable = { sizeof(grpc_pollset), + false, fd_create, fd_wrapped_fd, @@ -1717,6 +1724,7 @@ static const grpc_event_engine_vtable vtable = { fd_shutdown, fd_notify_on_read, fd_notify_on_write, + fd_notify_on_error, fd_is_shutdown, fd_get_read_notifier_pollset, |