aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/wakeup_fd_cv.h
diff options
context:
space:
mode:
authorGravatar Ken Payson <kpayson@google.com>2016-10-13 12:26:01 -0700
committerGravatar Ken Payson <kpayson@google.com>2016-10-13 12:26:01 -0700
commit82e4ec741ba3e564d1223f0f20355a6e27e70136 (patch)
tree688c0764549453a65b6d7e02cdd2f50c275257be /src/core/lib/iomgr/wakeup_fd_cv.h
parent7e73f8c2d8f46f9ea3491a897345047bed7a0ea0 (diff)
Moved cv polling into ev_poll_posix.c
Diffstat (limited to 'src/core/lib/iomgr/wakeup_fd_cv.h')
-rw-r--r--src/core/lib/iomgr/wakeup_fd_cv.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/wakeup_fd_cv.h b/src/core/lib/iomgr/wakeup_fd_cv.h
index e57fc28363..ac16be1750 100644
--- a/src/core/lib/iomgr/wakeup_fd_cv.h
+++ b/src/core/lib/iomgr/wakeup_fd_cv.h
@@ -48,8 +48,33 @@
#ifndef GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H
#define GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H
-#include "src/core/lib/iomgr/wakeup_fd_posix.h"
+#include <grpc/support/sync.h>
-extern grpc_wakeup_fd_vtable grpc_cv_wakeup_fd_vtable;
+#include "src/core/lib/iomgr/ev_posix.h"
+
+#define FD_TO_IDX(fd) (-(fd)-1)
+#define IDX_TO_FD(idx) (-(idx)-1)
+
+typedef struct cv_node {
+ gpr_cv* cv;
+ struct cv_node* next;
+} cv_node;
+
+typedef struct fd_node {
+ int is_set;
+ cv_node* cvs;
+ struct fd_node* next_free;
+} fd_node;
+
+typedef struct cv_fd_table {
+ gpr_mu mu;
+ int pollcount;
+ int shutdown;
+ gpr_cv shutdown_complete;
+ fd_node* cvfds;
+ fd_node* free_fds;
+ unsigned int size;
+ grpc_poll_function_type poll;
+} cv_fd_table;
#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H */