aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr/pollset.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/iomgr/pollset.h')
-rw-r--r--src/core/iomgr/pollset.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/iomgr/pollset.h b/src/core/iomgr/pollset.h
index ba1a9d5429..7374a4ec13 100644
--- a/src/core/iomgr/pollset.h
+++ b/src/core/iomgr/pollset.h
@@ -34,18 +34,31 @@
#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_H_
#define __GRPC_INTERNAL_IOMGR_POLLSET_H_
+#include <grpc/support/port_platform.h>
+
/* A grpc_pollset is a set of file descriptors that a higher level item is
interested in. For example:
- a server will typically keep a pollset containing all connected channels,
so that it can find new calls to service
- a completion queue might keep a pollset with an entry for each transport
that is servicing a call that it's tracking */
-/* Eventually different implementations of iomgr will provide their own
- grpc_pollset structs. As this is just a dummy wrapper to get the API in,
- we just define a simple type here. */
-typedef struct { char unused; } grpc_pollset;
+
+#ifdef GPR_POSIX_SOCKET
+#include "src/core/iomgr/pollset_posix.h"
+#endif
void grpc_pollset_init(grpc_pollset *pollset);
void grpc_pollset_destroy(grpc_pollset *pollset);
+/* Do some work on a pollset.
+ May involve invoking asynchronous callbacks, or actually polling file
+ descriptors.
+ Requires GRPC_POLLSET_MU(pollset) locked.
+ May unlock GRPC_POLLSET_MU(pollset) during its execution. */
+int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline);
+
+/* Break a pollset out of polling work
+ Requires GRPC_POLLSET_MU(pollset) locked. */
+void grpc_pollset_kick(grpc_pollset *pollset);
+
#endif /* __GRPC_INTERNAL_IOMGR_POLLSET_H_ */