aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr
diff options
context:
space:
mode:
authorGravatar vjpai <vpai@google.com>2016-02-15 02:33:54 -0800
committerGravatar vjpai <vpai@google.com>2016-02-15 02:33:54 -0800
commitcf4daebe2764cb5da664c7b2e406c48ee44dfeaa (patch)
tree739a164c69434fff24bf946ca50deca46502f1e5 /src/core/iomgr
parent8afd49f3599478e463a87134c129e92ab67b6e84 (diff)
Comment the requirements for changing grpc_poll_function and do
poll overrides in such a way as to avoid polling races
Diffstat (limited to 'src/core/iomgr')
-rw-r--r--src/core/iomgr/pollset_posix.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/iomgr/pollset_posix.h b/src/core/iomgr/pollset_posix.h
index b34bb09426..5868b3fa21 100644
--- a/src/core/iomgr/pollset_posix.h
+++ b/src/core/iomgr/pollset_posix.h
@@ -142,6 +142,10 @@ int grpc_pollset_has_workers(grpc_pollset *pollset);
void grpc_remove_fd_from_all_epoll_sets(int fd);
/* override to allow tests to hook poll() usage */
+/* NOTE: Any changes to grpc_poll_function must take place when the gRPC
+ is certainly not doing any polling anywhere.
+ Otherwise, there might be a race between changing the variable and actually
+ doing a polling operation */
typedef int (*grpc_poll_function_type)(struct pollfd *, nfds_t, int);
extern grpc_poll_function_type grpc_poll_function;
extern grpc_wakeup_fd grpc_global_wakeup_fd;