aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/ev_poll_posix.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2018-07-26 14:57:22 -0700
committerGravatar Yash Tibrewal <yashkt@google.com>2018-07-26 14:57:22 -0700
commit35925d5863eb820df2ac4e87a607a810e6bd83ab (patch)
tree1c3cc89a75dfd0002c0f2a004870644c983dae15 /src/core/lib/iomgr/ev_poll_posix.cc
parentd81fa7d6ece3c007e9c1f213de181c1a2aae3c1c (diff)
Add API to grpc event engines to forcibly set underlying fd to be readable/writable/errored
Diffstat (limited to 'src/core/lib/iomgr/ev_poll_posix.cc')
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index c9c09881a2..7801c02355 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -557,6 +557,23 @@ static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
abort();
}
+static void fd_set_readable(grpc_fd* fd) {
+ gpr_mu_lock(&fd->mu);
+ set_ready_locked(fd, &fd->read_closure);
+ gpr_mu_unlock(&fd->mu);
+}
+
+static void fd_set_writable(grpc_fd* fd) {
+ gpr_mu_lock(&fd->mu);
+ set_ready_locked(fd, &fd->write_closure);
+ gpr_mu_unlock(&fd->mu);
+}
+
+static void fd_set_error(grpc_fd* fd) {
+ 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) {
@@ -1723,6 +1740,9 @@ static const grpc_event_engine_vtable vtable = {
fd_notify_on_read,
fd_notify_on_write,
fd_notify_on_error,
+ fd_set_readable,
+ fd_set_writable,
+ fd_set_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,