Make out private bits private

pull/5647/head
Craig Tiller 9 years ago
parent 319f2897d8
commit a75d18addd
  1. 3
      BUILD
  2. 202
      Makefile
  3. 2
      gRPC.podspec
  4. 1
      grpc.gemspec
  5. 1
      package.json
  6. 1
      package.xml
  7. 411
      src/core/iomgr/ev_poll_and_epoll_posix.c
  8. 2
      src/core/iomgr/ev_poll_and_epoll_posix.h
  9. 124
      src/core/iomgr/ev_posix.c
  10. 27
      src/core/iomgr/ev_posix.h
  11. 2
      src/core/iomgr/iomgr.c
  12. 5
      src/core/iomgr/iomgr_internal.h
  13. 1
      src/core/iomgr/udp_server.h
  14. 12
      test/core/end2end/fixtures/h2_uchannel.c
  15. 6
      test/core/end2end/gen_build_yaml.py
  16. 8
      test/core/iomgr/fd_posix_test.c
  17. 15
      test/core/iomgr/tcp_client_posix_test.c
  18. 1
      tools/doxygen/Doxyfile.core.internal
  19. 127
      tools/run_tests/sources_and_headers.json
  20. 8332
      tools/run_tests/tests.json
  21. 1
      vsprojects/vcxproj/grpc/grpc.vcxproj
  22. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  23. 1
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  24. 3
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters

@ -203,7 +203,6 @@ cc_library(
"src/core/iomgr/iomgr_posix.h", "src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h", "src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h", "src/core/iomgr/resolve_address.h",
@ -530,7 +529,6 @@ cc_library(
"src/core/iomgr/iomgr_posix.h", "src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h", "src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h", "src/core/iomgr/resolve_address.h",
@ -1485,7 +1483,6 @@ objc_library(
"src/core/iomgr/iomgr_posix.h", "src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h", "src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h", "src/core/iomgr/resolve_address.h",

@ -1038,32 +1038,25 @@ h2_compress_test: $(BINDIR)/$(CONFIG)/h2_compress_test
h2_fakesec_test: $(BINDIR)/$(CONFIG)/h2_fakesec_test h2_fakesec_test: $(BINDIR)/$(CONFIG)/h2_fakesec_test
h2_full_test: $(BINDIR)/$(CONFIG)/h2_full_test h2_full_test: $(BINDIR)/$(CONFIG)/h2_full_test
h2_full+pipe_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_test h2_full+pipe_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_test
h2_full+poll_test: $(BINDIR)/$(CONFIG)/h2_full+poll_test
h2_full+poll+pipe_test: $(BINDIR)/$(CONFIG)/h2_full+poll+pipe_test
h2_oauth2_test: $(BINDIR)/$(CONFIG)/h2_oauth2_test h2_oauth2_test: $(BINDIR)/$(CONFIG)/h2_oauth2_test
h2_proxy_test: $(BINDIR)/$(CONFIG)/h2_proxy_test h2_proxy_test: $(BINDIR)/$(CONFIG)/h2_proxy_test
h2_sockpair_test: $(BINDIR)/$(CONFIG)/h2_sockpair_test h2_sockpair_test: $(BINDIR)/$(CONFIG)/h2_sockpair_test
h2_sockpair+trace_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_test h2_sockpair+trace_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_test
h2_sockpair_1byte_test: $(BINDIR)/$(CONFIG)/h2_sockpair_1byte_test h2_sockpair_1byte_test: $(BINDIR)/$(CONFIG)/h2_sockpair_1byte_test
h2_ssl_test: $(BINDIR)/$(CONFIG)/h2_ssl_test h2_ssl_test: $(BINDIR)/$(CONFIG)/h2_ssl_test
h2_ssl+poll_test: $(BINDIR)/$(CONFIG)/h2_ssl+poll_test
h2_ssl_proxy_test: $(BINDIR)/$(CONFIG)/h2_ssl_proxy_test h2_ssl_proxy_test: $(BINDIR)/$(CONFIG)/h2_ssl_proxy_test
h2_uchannel_test: $(BINDIR)/$(CONFIG)/h2_uchannel_test h2_uchannel_test: $(BINDIR)/$(CONFIG)/h2_uchannel_test
h2_uds_test: $(BINDIR)/$(CONFIG)/h2_uds_test h2_uds_test: $(BINDIR)/$(CONFIG)/h2_uds_test
h2_uds+poll_test: $(BINDIR)/$(CONFIG)/h2_uds+poll_test
h2_census_nosec_test: $(BINDIR)/$(CONFIG)/h2_census_nosec_test h2_census_nosec_test: $(BINDIR)/$(CONFIG)/h2_census_nosec_test
h2_compress_nosec_test: $(BINDIR)/$(CONFIG)/h2_compress_nosec_test h2_compress_nosec_test: $(BINDIR)/$(CONFIG)/h2_compress_nosec_test
h2_full_nosec_test: $(BINDIR)/$(CONFIG)/h2_full_nosec_test h2_full_nosec_test: $(BINDIR)/$(CONFIG)/h2_full_nosec_test
h2_full+pipe_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test h2_full+pipe_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test
h2_full+poll_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+poll_nosec_test
h2_full+poll+pipe_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+poll+pipe_nosec_test
h2_proxy_nosec_test: $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test h2_proxy_nosec_test: $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test
h2_sockpair_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test h2_sockpair_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test
h2_sockpair+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test h2_sockpair+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test
h2_sockpair_1byte_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_1byte_nosec_test h2_sockpair_1byte_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_1byte_nosec_test
h2_uchannel_nosec_test: $(BINDIR)/$(CONFIG)/h2_uchannel_nosec_test h2_uchannel_nosec_test: $(BINDIR)/$(CONFIG)/h2_uchannel_nosec_test
h2_uds_nosec_test: $(BINDIR)/$(CONFIG)/h2_uds_nosec_test h2_uds_nosec_test: $(BINDIR)/$(CONFIG)/h2_uds_nosec_test
h2_uds+poll_nosec_test: $(BINDIR)/$(CONFIG)/h2_uds+poll_nosec_test
run_dep_checks: run_dep_checks:
$(OPENSSL_ALPN_CHECK_CMD) || true $(OPENSSL_ALPN_CHECK_CMD) || true
@ -1256,32 +1249,25 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/h2_fakesec_test \ $(BINDIR)/$(CONFIG)/h2_fakesec_test \
$(BINDIR)/$(CONFIG)/h2_full_test \ $(BINDIR)/$(CONFIG)/h2_full_test \
$(BINDIR)/$(CONFIG)/h2_full+pipe_test \ $(BINDIR)/$(CONFIG)/h2_full+pipe_test \
$(BINDIR)/$(CONFIG)/h2_full+poll_test \
$(BINDIR)/$(CONFIG)/h2_full+poll+pipe_test \
$(BINDIR)/$(CONFIG)/h2_oauth2_test \ $(BINDIR)/$(CONFIG)/h2_oauth2_test \
$(BINDIR)/$(CONFIG)/h2_proxy_test \ $(BINDIR)/$(CONFIG)/h2_proxy_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_test \
$(BINDIR)/$(CONFIG)/h2_sockpair+trace_test \ $(BINDIR)/$(CONFIG)/h2_sockpair+trace_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_1byte_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_1byte_test \
$(BINDIR)/$(CONFIG)/h2_ssl_test \ $(BINDIR)/$(CONFIG)/h2_ssl_test \
$(BINDIR)/$(CONFIG)/h2_ssl+poll_test \
$(BINDIR)/$(CONFIG)/h2_ssl_proxy_test \ $(BINDIR)/$(CONFIG)/h2_ssl_proxy_test \
$(BINDIR)/$(CONFIG)/h2_uchannel_test \ $(BINDIR)/$(CONFIG)/h2_uchannel_test \
$(BINDIR)/$(CONFIG)/h2_uds_test \ $(BINDIR)/$(CONFIG)/h2_uds_test \
$(BINDIR)/$(CONFIG)/h2_uds+poll_test \
$(BINDIR)/$(CONFIG)/h2_census_nosec_test \ $(BINDIR)/$(CONFIG)/h2_census_nosec_test \
$(BINDIR)/$(CONFIG)/h2_compress_nosec_test \ $(BINDIR)/$(CONFIG)/h2_compress_nosec_test \
$(BINDIR)/$(CONFIG)/h2_full_nosec_test \ $(BINDIR)/$(CONFIG)/h2_full_nosec_test \
$(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test \ $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test \
$(BINDIR)/$(CONFIG)/h2_full+poll_nosec_test \
$(BINDIR)/$(CONFIG)/h2_full+poll+pipe_nosec_test \
$(BINDIR)/$(CONFIG)/h2_proxy_nosec_test \ $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test \ $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_1byte_nosec_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_1byte_nosec_test \
$(BINDIR)/$(CONFIG)/h2_uchannel_nosec_test \ $(BINDIR)/$(CONFIG)/h2_uchannel_nosec_test \
$(BINDIR)/$(CONFIG)/h2_uds_nosec_test \ $(BINDIR)/$(CONFIG)/h2_uds_nosec_test \
$(BINDIR)/$(CONFIG)/h2_uds+poll_nosec_test \
buildtests_cxx: buildtests_zookeeper privatelibs_cxx \ buildtests_cxx: buildtests_zookeeper privatelibs_cxx \
@ -12359,70 +12345,6 @@ endif
endif endif
H2_FULL+POLL_TEST_SRC = \
test/core/end2end/fixtures/h2_full+poll.c \
H2_FULL+POLL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+POLL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/h2_full+poll_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/h2_full+poll_test: $(H2_FULL+POLL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_FULL+POLL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/h2_full+poll_test
endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_full+poll.o: $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_h2_full+poll_test: $(H2_FULL+POLL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(H2_FULL+POLL_TEST_OBJS:.o=.dep)
endif
endif
H2_FULL+POLL+PIPE_TEST_SRC = \
test/core/end2end/fixtures/h2_full+poll+pipe.c \
H2_FULL+POLL+PIPE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+POLL+PIPE_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/h2_full+poll+pipe_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/h2_full+poll+pipe_test: $(H2_FULL+POLL+PIPE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_FULL+POLL+PIPE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/h2_full+poll+pipe_test
endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_full+poll+pipe.o: $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_h2_full+poll+pipe_test: $(H2_FULL+POLL+PIPE_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(H2_FULL+POLL+PIPE_TEST_OBJS:.o=.dep)
endif
endif
H2_OAUTH2_TEST_SRC = \ H2_OAUTH2_TEST_SRC = \
test/core/end2end/fixtures/h2_oauth2.c \ test/core/end2end/fixtures/h2_oauth2.c \
@ -12615,38 +12537,6 @@ endif
endif endif
H2_SSL+POLL_TEST_SRC = \
test/core/end2end/fixtures/h2_ssl+poll.c \
H2_SSL+POLL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SSL+POLL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/h2_ssl+poll_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/h2_ssl+poll_test: $(H2_SSL+POLL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_SSL+POLL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/h2_ssl+poll_test
endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_ssl+poll.o: $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_h2_ssl+poll_test: $(H2_SSL+POLL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(H2_SSL+POLL_TEST_OBJS:.o=.dep)
endif
endif
H2_SSL_PROXY_TEST_SRC = \ H2_SSL_PROXY_TEST_SRC = \
test/core/end2end/fixtures/h2_ssl_proxy.c \ test/core/end2end/fixtures/h2_ssl_proxy.c \
@ -12743,38 +12633,6 @@ endif
endif endif
H2_UDS+POLL_TEST_SRC = \
test/core/end2end/fixtures/h2_uds+poll.c \
H2_UDS+POLL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_UDS+POLL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/h2_uds+poll_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/h2_uds+poll_test: $(H2_UDS+POLL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_UDS+POLL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/h2_uds+poll_test
endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_uds+poll.o: $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_h2_uds+poll_test: $(H2_UDS+POLL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(H2_UDS+POLL_TEST_OBJS:.o=.dep)
endif
endif
H2_CENSUS_NOSEC_TEST_SRC = \ H2_CENSUS_NOSEC_TEST_SRC = \
test/core/end2end/fixtures/h2_census.c \ test/core/end2end/fixtures/h2_census.c \
@ -12855,46 +12713,6 @@ ifneq ($(NO_DEPS),true)
endif endif
H2_FULL+POLL_NOSEC_TEST_SRC = \
test/core/end2end/fixtures/h2_full+poll.c \
H2_FULL+POLL_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+POLL_NOSEC_TEST_SRC))))
$(BINDIR)/$(CONFIG)/h2_full+poll_nosec_test: $(H2_FULL+POLL_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_FULL+POLL_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) -o $(BINDIR)/$(CONFIG)/h2_full+poll_nosec_test
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_full+poll.o: $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_h2_full+poll_nosec_test: $(H2_FULL+POLL_NOSEC_TEST_OBJS:.o=.dep)
ifneq ($(NO_DEPS),true)
-include $(H2_FULL+POLL_NOSEC_TEST_OBJS:.o=.dep)
endif
H2_FULL+POLL+PIPE_NOSEC_TEST_SRC = \
test/core/end2end/fixtures/h2_full+poll+pipe.c \
H2_FULL+POLL+PIPE_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+POLL+PIPE_NOSEC_TEST_SRC))))
$(BINDIR)/$(CONFIG)/h2_full+poll+pipe_nosec_test: $(H2_FULL+POLL+PIPE_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_FULL+POLL+PIPE_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) -o $(BINDIR)/$(CONFIG)/h2_full+poll+pipe_nosec_test
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_full+poll+pipe.o: $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_h2_full+poll+pipe_nosec_test: $(H2_FULL+POLL+PIPE_NOSEC_TEST_OBJS:.o=.dep)
ifneq ($(NO_DEPS),true)
-include $(H2_FULL+POLL+PIPE_NOSEC_TEST_OBJS:.o=.dep)
endif
H2_PROXY_NOSEC_TEST_SRC = \ H2_PROXY_NOSEC_TEST_SRC = \
test/core/end2end/fixtures/h2_proxy.c \ test/core/end2end/fixtures/h2_proxy.c \
@ -13015,26 +12833,6 @@ ifneq ($(NO_DEPS),true)
endif endif
H2_UDS+POLL_NOSEC_TEST_SRC = \
test/core/end2end/fixtures/h2_uds+poll.c \
H2_UDS+POLL_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_UDS+POLL_NOSEC_TEST_SRC))))
$(BINDIR)/$(CONFIG)/h2_uds+poll_nosec_test: $(H2_UDS+POLL_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_UDS+POLL_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) -o $(BINDIR)/$(CONFIG)/h2_uds+poll_nosec_test
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_uds+poll.o: $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_h2_uds+poll_nosec_test: $(H2_UDS+POLL_NOSEC_TEST_OBJS:.o=.dep)
ifneq ($(NO_DEPS),true)
-include $(H2_UDS+POLL_NOSEC_TEST_OBJS:.o=.dep)
endif

@ -207,7 +207,6 @@ Pod::Spec.new do |s|
'src/core/iomgr/iomgr_posix.h', 'src/core/iomgr/iomgr_posix.h',
'src/core/iomgr/pollset.h', 'src/core/iomgr/pollset.h',
'src/core/iomgr/pollset_set.h', 'src/core/iomgr/pollset_set.h',
'src/core/iomgr/pollset_set_posix.h',
'src/core/iomgr/pollset_set_windows.h', 'src/core/iomgr/pollset_set_windows.h',
'src/core/iomgr/pollset_windows.h', 'src/core/iomgr/pollset_windows.h',
'src/core/iomgr/resolve_address.h', 'src/core/iomgr/resolve_address.h',
@ -525,7 +524,6 @@ Pod::Spec.new do |s|
'src/core/iomgr/iomgr_posix.h', 'src/core/iomgr/iomgr_posix.h',
'src/core/iomgr/pollset.h', 'src/core/iomgr/pollset.h',
'src/core/iomgr/pollset_set.h', 'src/core/iomgr/pollset_set.h',
'src/core/iomgr/pollset_set_posix.h',
'src/core/iomgr/pollset_set_windows.h', 'src/core/iomgr/pollset_set_windows.h',
'src/core/iomgr/pollset_windows.h', 'src/core/iomgr/pollset_windows.h',
'src/core/iomgr/resolve_address.h', 'src/core/iomgr/resolve_address.h',

@ -203,7 +203,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/iomgr/iomgr_posix.h ) s.files += %w( src/core/iomgr/iomgr_posix.h )
s.files += %w( src/core/iomgr/pollset.h ) s.files += %w( src/core/iomgr/pollset.h )
s.files += %w( src/core/iomgr/pollset_set.h ) s.files += %w( src/core/iomgr/pollset_set.h )
s.files += %w( src/core/iomgr/pollset_set_posix.h )
s.files += %w( src/core/iomgr/pollset_set_windows.h ) s.files += %w( src/core/iomgr/pollset_set_windows.h )
s.files += %w( src/core/iomgr/pollset_windows.h ) s.files += %w( src/core/iomgr/pollset_windows.h )
s.files += %w( src/core/iomgr/resolve_address.h ) s.files += %w( src/core/iomgr/resolve_address.h )

@ -147,7 +147,6 @@
"src/core/iomgr/iomgr_posix.h", "src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h", "src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h", "src/core/iomgr/resolve_address.h",

@ -207,7 +207,6 @@
<file baseinstalldir="/" name="src/core/iomgr/iomgr_posix.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/iomgr_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/pollset.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/pollset.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/pollset_set.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/pollset_set.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/pollset_set_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/pollset_set_windows.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/pollset_set_windows.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/pollset_windows.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/pollset_windows.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/resolve_address.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/resolve_address.h" role="src" />

@ -139,42 +139,43 @@ struct grpc_fd {
Polling strategies that do not need to alter their behavior depending on the Polling strategies that do not need to alter their behavior depending on the
fd's current interest (such as epoll) do not need to call this function. fd's current interest (such as epoll) do not need to call this function.
MUST NOT be called with a pollset lock taken */ MUST NOT be called with a pollset lock taken */
uint32_t grpc_fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset, static uint32_t fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
grpc_pollset_worker *worker, uint32_t read_mask, grpc_pollset_worker *worker, uint32_t read_mask,
uint32_t write_mask, grpc_fd_watcher *rec); uint32_t write_mask, grpc_fd_watcher *rec);
/* Complete polling previously started with grpc_fd_begin_poll /* Complete polling previously started with fd_begin_poll
MUST NOT be called with a pollset lock taken MUST NOT be called with a pollset lock taken
if got_read or got_write are 1, also does the become_{readable,writable} as if got_read or got_write are 1, also does the become_{readable,writable} as
appropriate. */ appropriate. */
void grpc_fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *rec, static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *rec,
int got_read, int got_write); int got_read, int got_write);
/* Return 1 if this fd is orphaned, 0 otherwise */ /* Return 1 if this fd is orphaned, 0 otherwise */
int grpc_fd_is_orphaned(grpc_fd *fd); static bool fd_is_orphaned(grpc_fd *fd);
/* Notification from the poller to an fd that it has become readable or /* Notification from the poller to an fd that it has become readable or
writable. writable.
If allow_synchronous_callback is 1, allow running the fd callback inline If allow_synchronous_callback is 1, allow running the fd callback inline
in this callstack, otherwise register an asynchronous callback and return */ in this callstack, otherwise register an asynchronous callback and return */
void grpc_fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd); static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
void grpc_fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd); static void fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
/* Reference counting for fds */ /* Reference counting for fds */
/*#define GRPC_FD_REF_COUNT_DEBUG*/ /*#define GRPC_FD_REF_COUNT_DEBUG*/
#ifdef GRPC_FD_REF_COUNT_DEBUG #ifdef GRPC_FD_REF_COUNT_DEBUG
void grpc_fd_ref(grpc_fd *fd, const char *reason, const char *file, int line); static void fd_ref(grpc_fd *fd, const char *reason, const char *file, int line);
void grpc_fd_unref(grpc_fd *fd, const char *reason, const char *file, int line); static void fd_unref(grpc_fd *fd, const char *reason, const char *file,
#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd, reason, __FILE__, __LINE__) int line);
#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd, reason, __FILE__, __LINE__) #define GRPC_FD_REF(fd, reason) fd_ref(fd, reason, __FILE__, __LINE__)
#define GRPC_FD_UNREF(fd, reason) fd_unref(fd, reason, __FILE__, __LINE__)
#else #else
void grpc_fd_ref(grpc_fd *fd); static void fd_ref(grpc_fd *fd);
void grpc_fd_unref(grpc_fd *fd); static void fd_unref(grpc_fd *fd);
#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd) #define GRPC_FD_REF(fd, reason) fd_ref(fd)
#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd) #define GRPC_FD_UNREF(fd, reason) fd_unref(fd)
#endif #endif
void grpc_fd_global_init(void); static void fd_global_init(void);
void grpc_fd_global_shutdown(void); static void fd_global_shutdown(void);
#define CLOSURE_NOT_READY ((grpc_closure *)0) #define CLOSURE_NOT_READY ((grpc_closure *)0)
#define CLOSURE_READY ((grpc_closure *)1) #define CLOSURE_READY ((grpc_closure *)1)
@ -231,13 +232,11 @@ struct grpc_pollset_vtable {
}; };
/* Add an fd to a pollset */ /* Add an fd to a pollset */
void grpc_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
struct grpc_fd *fd); struct grpc_fd *fd);
/* Returns the fd to listen on for kicks */ static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
int grpc_kick_read_fd(grpc_pollset *p); grpc_pollset_set *pollset_set, grpc_fd *fd);
/* Call after polling has been kicked to leave the kicked state */
void grpc_kick_drain(grpc_pollset *p);
/* Convert a timespec to milliseconds: /* Convert a timespec to milliseconds:
- very small or negative poll times are clamped to zero to do a - very small or negative poll times are clamped to zero to do a
@ -246,35 +245,31 @@ void grpc_kick_drain(grpc_pollset *p);
- longer than a millisecond polls are rounded up to the next nearest - longer than a millisecond polls are rounded up to the next nearest
millisecond to avoid spinning millisecond to avoid spinning
- infinite timeouts are converted to -1 */ - infinite timeouts are converted to -1 */
int grpc_poll_deadline_to_millis_timeout(gpr_timespec deadline, static int poll_deadline_to_millis_timeout(gpr_timespec deadline,
gpr_timespec now); gpr_timespec now);
/* Allow kick to wakeup the currently polling worker */ /* Allow kick to wakeup the currently polling worker */
#define GRPC_POLLSET_CAN_KICK_SELF 1 #define GRPC_POLLSET_CAN_KICK_SELF 1
/* Force the wakee to repoll when awoken */ /* Force the wakee to repoll when awoken */
#define GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP 2 #define GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP 2
/* As per grpc_pollset_kick, with an extended set of flags (defined above) /* As per pollset_kick, with an extended set of flags (defined above)
-- mostly for fd_posix's use. */ -- mostly for fd_posix's use. */
void grpc_pollset_kick_ext(grpc_pollset *p, static void pollset_kick_ext(grpc_pollset *p,
grpc_pollset_worker *specific_worker, grpc_pollset_worker *specific_worker,
uint32_t flags); uint32_t flags);
/* turn a pollset into a multipoller: platform specific */ /* turn a pollset into a multipoller: platform specific */
typedef void (*grpc_platform_become_multipoller_type)(grpc_exec_ctx *exec_ctx, typedef void (*platform_become_multipoller_type)(grpc_exec_ctx *exec_ctx,
grpc_pollset *pollset, grpc_pollset *pollset,
struct grpc_fd **fds, struct grpc_fd **fds,
size_t fd_count); size_t fd_count);
extern grpc_platform_become_multipoller_type grpc_platform_become_multipoller; static platform_become_multipoller_type platform_become_multipoller;
void grpc_poll_become_multipoller(grpc_exec_ctx *exec_ctx, /* Return 1 if the pollset has active threads in pollset_work (pollset must
grpc_pollset *pollset, struct grpc_fd **fds,
size_t fd_count);
/* Return 1 if the pollset has active threads in grpc_pollset_work (pollset must
* be locked) */ * be locked) */
int grpc_pollset_has_workers(grpc_pollset *pollset); static int pollset_has_workers(grpc_pollset *pollset);
void grpc_remove_fd_from_all_epoll_sets(int fd); static void remove_fd_from_all_epoll_sets(int fd);
/* override to allow tests to hook poll() usage */ /* override to allow tests to hook poll() usage */
typedef int (*grpc_poll_function_type)(struct pollfd *, nfds_t, int); typedef int (*grpc_poll_function_type)(struct pollfd *, nfds_t, int);
@ -401,9 +396,9 @@ static void unref_by(grpc_fd *fd, int n) {
} }
} }
void grpc_fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); } static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
void grpc_fd_global_shutdown(void) { static void fd_global_shutdown(void) {
gpr_mu_lock(&fd_freelist_mu); gpr_mu_lock(&fd_freelist_mu);
gpr_mu_unlock(&fd_freelist_mu); gpr_mu_unlock(&fd_freelist_mu);
while (fd_freelist != NULL) { while (fd_freelist != NULL) {
@ -414,7 +409,7 @@ void grpc_fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu); gpr_mu_destroy(&fd_freelist_mu);
} }
grpc_fd *grpc_fd_create(int fd, const char *name) { static grpc_fd *fd_create(int fd, const char *name) {
grpc_fd *r = alloc_fd(fd); grpc_fd *r = alloc_fd(fd);
char *name2; char *name2;
gpr_asprintf(&name2, "%s fd=%d", name, fd); gpr_asprintf(&name2, "%s fd=%d", name, fd);
@ -426,15 +421,15 @@ grpc_fd *grpc_fd_create(int fd, const char *name) {
return r; return r;
} }
int grpc_fd_is_orphaned(grpc_fd *fd) { static bool fd_is_orphaned(grpc_fd *fd) {
return (gpr_atm_acq_load(&fd->refst) & 1) == 0; return (gpr_atm_acq_load(&fd->refst) & 1) == 0;
} }
static void pollset_kick_locked(grpc_fd_watcher *watcher) { static void pollset_kick_locked(grpc_fd_watcher *watcher) {
gpr_mu_lock(watcher->pollset->mu); gpr_mu_lock(watcher->pollset->mu);
GPR_ASSERT(watcher->worker); GPR_ASSERT(watcher->worker);
grpc_pollset_kick_ext(watcher->pollset, watcher->worker, pollset_kick_ext(watcher->pollset, watcher->worker,
GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP); GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP);
gpr_mu_unlock(watcher->pollset->mu); gpr_mu_unlock(watcher->pollset->mu);
} }
@ -472,12 +467,12 @@ static void close_fd_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
if (!fd->released) { if (!fd->released) {
close(fd->fd); close(fd->fd);
} else { } else {
grpc_remove_fd_from_all_epoll_sets(fd->fd); remove_fd_from_all_epoll_sets(fd->fd);
} }
grpc_exec_ctx_enqueue(exec_ctx, fd->on_done_closure, true, NULL); grpc_exec_ctx_enqueue(exec_ctx, fd->on_done_closure, true, NULL);
} }
int grpc_fd_wrapped_fd(grpc_fd *fd) { static int fd_wrapped_fd(grpc_fd *fd) {
if (fd->released || fd->closed) { if (fd->released || fd->closed) {
return -1; return -1;
} else { } else {
@ -485,8 +480,9 @@ int grpc_fd_wrapped_fd(grpc_fd *fd) {
} }
} }
void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done, static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
int *release_fd, const char *reason) { grpc_closure *on_done, int *release_fd,
const char *reason) {
fd->on_done_closure = on_done; fd->on_done_closure = on_done;
fd->released = release_fd != NULL; fd->released = release_fd != NULL;
if (!fd->released) { if (!fd->released) {
@ -507,18 +503,19 @@ void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
/* increment refcount by two to avoid changing the orphan bit */ /* increment refcount by two to avoid changing the orphan bit */
#ifdef GRPC_FD_REF_COUNT_DEBUG #ifdef GRPC_FD_REF_COUNT_DEBUG
void grpc_fd_ref(grpc_fd *fd, const char *reason, const char *file, int line) { static void fd_ref(grpc_fd *fd, const char *reason, const char *file,
int line) {
ref_by(fd, 2, reason, file, line); ref_by(fd, 2, reason, file, line);
} }
void grpc_fd_unref(grpc_fd *fd, const char *reason, const char *file, static void fd_unref(grpc_fd *fd, const char *reason, const char *file,
int line) { int line) {
unref_by(fd, 2, reason, file, line); unref_by(fd, 2, reason, file, line);
} }
#else #else
void grpc_fd_ref(grpc_fd *fd) { ref_by(fd, 2); } static void fd_ref(grpc_fd *fd) { ref_by(fd, 2); }
void grpc_fd_unref(grpc_fd *fd) { unref_by(fd, 2); } static void fd_unref(grpc_fd *fd) { unref_by(fd, 2); }
#endif #endif
static void notify_on_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd, static void notify_on_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
@ -566,7 +563,7 @@ static void set_ready(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure **st) {
gpr_mu_unlock(&fd->mu); gpr_mu_unlock(&fd->mu);
} }
void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) { static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
gpr_mu_lock(&fd->mu); gpr_mu_lock(&fd->mu);
GPR_ASSERT(!fd->shutdown); GPR_ASSERT(!fd->shutdown);
fd->shutdown = 1; fd->shutdown = 1;
@ -575,23 +572,23 @@ void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
gpr_mu_unlock(&fd->mu); gpr_mu_unlock(&fd->mu);
} }
void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd, static void fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *closure) { grpc_closure *closure) {
gpr_mu_lock(&fd->mu); gpr_mu_lock(&fd->mu);
notify_on_locked(exec_ctx, fd, &fd->read_closure, closure); notify_on_locked(exec_ctx, fd, &fd->read_closure, closure);
gpr_mu_unlock(&fd->mu); gpr_mu_unlock(&fd->mu);
} }
void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd, static void fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *closure) { grpc_closure *closure) {
gpr_mu_lock(&fd->mu); gpr_mu_lock(&fd->mu);
notify_on_locked(exec_ctx, fd, &fd->write_closure, closure); notify_on_locked(exec_ctx, fd, &fd->write_closure, closure);
gpr_mu_unlock(&fd->mu); gpr_mu_unlock(&fd->mu);
} }
uint32_t grpc_fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset, static uint32_t fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
grpc_pollset_worker *worker, uint32_t read_mask, grpc_pollset_worker *worker, uint32_t read_mask,
uint32_t write_mask, grpc_fd_watcher *watcher) { uint32_t write_mask, grpc_fd_watcher *watcher) {
uint32_t mask = 0; uint32_t mask = 0;
grpc_closure *cur; grpc_closure *cur;
int requested; int requested;
@ -640,8 +637,8 @@ uint32_t grpc_fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
return mask; return mask;
} }
void grpc_fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher, static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
int got_read, int got_write) { int got_read, int got_write) {
int was_polling = 0; int was_polling = 0;
int kick = 0; int kick = 0;
grpc_fd *fd = watcher->fd; grpc_fd *fd = watcher->fd;
@ -686,7 +683,7 @@ void grpc_fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
if (kick) { if (kick) {
maybe_wake_one_watcher_locked(fd); maybe_wake_one_watcher_locked(fd);
} }
if (grpc_fd_is_orphaned(fd) && !has_watchers(fd) && !fd->closed) { if (fd_is_orphaned(fd) && !has_watchers(fd) && !fd->closed) {
close_fd_locked(exec_ctx, fd); close_fd_locked(exec_ctx, fd);
} }
gpr_mu_unlock(&fd->mu); gpr_mu_unlock(&fd->mu);
@ -694,11 +691,11 @@ void grpc_fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
GRPC_FD_UNREF(fd, "poll"); GRPC_FD_UNREF(fd, "poll");
} }
void grpc_fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) { static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
set_ready(exec_ctx, fd, &fd->read_closure); set_ready(exec_ctx, fd, &fd->read_closure);
} }
void grpc_fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) { static void fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
set_ready(exec_ctx, fd, &fd->write_closure); set_ready(exec_ctx, fd, &fd->write_closure);
} }
@ -724,12 +721,12 @@ static void remove_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
worker->next->prev = worker->prev; worker->next->prev = worker->prev;
} }
int grpc_pollset_has_workers(grpc_pollset *p) { static int pollset_has_workers(grpc_pollset *p) {
return p->root_worker.next != &p->root_worker; return p->root_worker.next != &p->root_worker;
} }
static grpc_pollset_worker *pop_front_worker(grpc_pollset *p) { static grpc_pollset_worker *pop_front_worker(grpc_pollset *p) {
if (grpc_pollset_has_workers(p)) { if (pollset_has_workers(p)) {
grpc_pollset_worker *w = p->root_worker.next; grpc_pollset_worker *w = p->root_worker.next;
remove_worker(p, w); remove_worker(p, w);
return w; return w;
@ -750,17 +747,15 @@ static void push_front_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
worker->prev->next = worker->next->prev = worker; worker->prev->next = worker->next->prev = worker;
} }
size_t grpc_pollset_size(void) { return sizeof(grpc_pollset); } static void pollset_kick_ext(grpc_pollset *p,
grpc_pollset_worker *specific_worker,
void grpc_pollset_kick_ext(grpc_pollset *p, uint32_t flags) {
grpc_pollset_worker *specific_worker, GPR_TIMER_BEGIN("pollset_kick_ext", 0);
uint32_t flags) {
GPR_TIMER_BEGIN("grpc_pollset_kick_ext", 0);
/* pollset->mu already held */ /* pollset->mu already held */
if (specific_worker != NULL) { if (specific_worker != NULL) {
if (specific_worker == GRPC_POLLSET_KICK_BROADCAST) { if (specific_worker == GRPC_POLLSET_KICK_BROADCAST) {
GPR_TIMER_BEGIN("grpc_pollset_kick_ext.broadcast", 0); GPR_TIMER_BEGIN("pollset_kick_ext.broadcast", 0);
GPR_ASSERT((flags & GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) == 0); GPR_ASSERT((flags & GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) == 0);
for (specific_worker = p->root_worker.next; for (specific_worker = p->root_worker.next;
specific_worker != &p->root_worker; specific_worker != &p->root_worker;
@ -768,7 +763,7 @@ void grpc_pollset_kick_ext(grpc_pollset *p,
grpc_wakeup_fd_wakeup(&specific_worker->wakeup_fd->fd); grpc_wakeup_fd_wakeup(&specific_worker->wakeup_fd->fd);
} }
p->kicked_without_pollers = 1; p->kicked_without_pollers = 1;
GPR_TIMER_END("grpc_pollset_kick_ext.broadcast", 0); GPR_TIMER_END("pollset_kick_ext.broadcast", 0);
} else if (gpr_tls_get(&g_current_thread_worker) != } else if (gpr_tls_get(&g_current_thread_worker) !=
(intptr_t)specific_worker) { (intptr_t)specific_worker) {
GPR_TIMER_MARK("different_thread_worker", 0); GPR_TIMER_MARK("different_thread_worker", 0);
@ -812,36 +807,37 @@ void grpc_pollset_kick_ext(grpc_pollset *p,
} }
} }
GPR_TIMER_END("grpc_pollset_kick_ext", 0); GPR_TIMER_END("pollset_kick_ext", 0);
} }
void grpc_pollset_kick(grpc_pollset *p, grpc_pollset_worker *specific_worker) { static void pollset_kick(grpc_pollset *p,
grpc_pollset_kick_ext(p, specific_worker, 0); grpc_pollset_worker *specific_worker) {
pollset_kick_ext(p, specific_worker, 0);
} }
/* global state management */ /* global state management */
void grpc_pollset_global_init(void) { static void pollset_global_init(void) {
gpr_tls_init(&g_current_thread_poller); gpr_tls_init(&g_current_thread_poller);
gpr_tls_init(&g_current_thread_worker); gpr_tls_init(&g_current_thread_worker);
grpc_wakeup_fd_global_init(); grpc_wakeup_fd_global_init();
grpc_wakeup_fd_init(&grpc_global_wakeup_fd); grpc_wakeup_fd_init(&grpc_global_wakeup_fd);
} }
void grpc_pollset_global_shutdown(void) { static void pollset_global_shutdown(void) {
grpc_wakeup_fd_destroy(&grpc_global_wakeup_fd); grpc_wakeup_fd_destroy(&grpc_global_wakeup_fd);
gpr_tls_destroy(&g_current_thread_poller); gpr_tls_destroy(&g_current_thread_poller);
gpr_tls_destroy(&g_current_thread_worker); gpr_tls_destroy(&g_current_thread_worker);
grpc_wakeup_fd_global_destroy(); grpc_wakeup_fd_global_destroy();
} }
void grpc_kick_poller(void) { grpc_wakeup_fd_wakeup(&grpc_global_wakeup_fd); } static void kick_poller(void) { grpc_wakeup_fd_wakeup(&grpc_global_wakeup_fd); }
/* main interface */ /* main interface */
static void become_basic_pollset(grpc_pollset *pollset, grpc_fd *fd_or_null); static void become_basic_pollset(grpc_pollset *pollset, grpc_fd *fd_or_null);
void grpc_pollset_init(grpc_pollset *pollset, gpr_mu *mu) { static void pollset_init(grpc_pollset *pollset, gpr_mu *mu) {
pollset->mu = mu; pollset->mu = mu;
pollset->root_worker.next = pollset->root_worker.prev = &pollset->root_worker; pollset->root_worker.next = pollset->root_worker.prev = &pollset->root_worker;
pollset->in_flight_cbs = 0; pollset->in_flight_cbs = 0;
@ -854,9 +850,9 @@ void grpc_pollset_init(grpc_pollset *pollset, gpr_mu *mu) {
become_basic_pollset(pollset, NULL); become_basic_pollset(pollset, NULL);
} }
void grpc_pollset_destroy(grpc_pollset *pollset) { static void pollset_destroy(grpc_pollset *pollset) {
GPR_ASSERT(pollset->in_flight_cbs == 0); GPR_ASSERT(pollset->in_flight_cbs == 0);
GPR_ASSERT(!grpc_pollset_has_workers(pollset)); GPR_ASSERT(!pollset_has_workers(pollset));
GPR_ASSERT(pollset->idle_jobs.head == pollset->idle_jobs.tail); GPR_ASSERT(pollset->idle_jobs.head == pollset->idle_jobs.tail);
pollset->vtable->destroy(pollset); pollset->vtable->destroy(pollset);
while (pollset->local_wakeup_cache) { while (pollset->local_wakeup_cache) {
@ -867,10 +863,10 @@ void grpc_pollset_destroy(grpc_pollset *pollset) {
} }
} }
void grpc_pollset_reset(grpc_pollset *pollset) { static void pollset_reset(grpc_pollset *pollset) {
GPR_ASSERT(pollset->shutting_down); GPR_ASSERT(pollset->shutting_down);
GPR_ASSERT(pollset->in_flight_cbs == 0); GPR_ASSERT(pollset->in_flight_cbs == 0);
GPR_ASSERT(!grpc_pollset_has_workers(pollset)); GPR_ASSERT(!pollset_has_workers(pollset));
GPR_ASSERT(pollset->idle_jobs.head == pollset->idle_jobs.tail); GPR_ASSERT(pollset->idle_jobs.head == pollset->idle_jobs.tail);
pollset->vtable->destroy(pollset); pollset->vtable->destroy(pollset);
pollset->shutting_down = 0; pollset->shutting_down = 0;
@ -879,8 +875,8 @@ void grpc_pollset_reset(grpc_pollset *pollset) {
become_basic_pollset(pollset, NULL); become_basic_pollset(pollset, NULL);
} }
void grpc_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_fd *fd) { grpc_fd *fd) {
gpr_mu_lock(pollset->mu); gpr_mu_lock(pollset->mu);
pollset->vtable->add_fd(exec_ctx, pollset, fd, 1); pollset->vtable->add_fd(exec_ctx, pollset, fd, 1);
/* the following (enabled only in debug) will reacquire and then release /* the following (enabled only in debug) will reacquire and then release
@ -899,9 +895,9 @@ static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
grpc_exec_ctx_enqueue(exec_ctx, pollset->shutdown_done, true, NULL); grpc_exec_ctx_enqueue(exec_ctx, pollset->shutdown_done, true, NULL);
} }
void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, static void pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_pollset_worker **worker_hdl, gpr_timespec now, grpc_pollset_worker **worker_hdl, gpr_timespec now,
gpr_timespec deadline) { gpr_timespec deadline) {
grpc_pollset_worker worker; grpc_pollset_worker worker;
*worker_hdl = &worker; *worker_hdl = &worker;
@ -910,7 +906,7 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
int locked = 1; int locked = 1;
int queued_work = 0; int queued_work = 0;
int keep_polling = 0; int keep_polling = 0;
GPR_TIMER_BEGIN("grpc_pollset_work", 0); GPR_TIMER_BEGIN("pollset_work", 0);
/* this must happen before we (potentially) drop pollset->mu */ /* this must happen before we (potentially) drop pollset->mu */
worker.next = worker.prev = NULL; worker.next = worker.prev = NULL;
worker.reevaluate_polling_on_wakeup = 0; worker.reevaluate_polling_on_wakeup = 0;
@ -924,20 +920,20 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
worker.kicked_specifically = 0; worker.kicked_specifically = 0;
/* If there's work waiting for the pollset to be idle, and the /* If there's work waiting for the pollset to be idle, and the
pollset is idle, then do that work */ pollset is idle, then do that work */
if (!grpc_pollset_has_workers(pollset) && if (!pollset_has_workers(pollset) &&
!grpc_closure_list_empty(pollset->idle_jobs)) { !grpc_closure_list_empty(pollset->idle_jobs)) {
GPR_TIMER_MARK("grpc_pollset_work.idle_jobs", 0); GPR_TIMER_MARK("pollset_work.idle_jobs", 0);
grpc_exec_ctx_enqueue_list(exec_ctx, &pollset->idle_jobs, NULL); grpc_exec_ctx_enqueue_list(exec_ctx, &pollset->idle_jobs, NULL);
goto done; goto done;
} }
/* If we're shutting down then we don't execute any extended work */ /* If we're shutting down then we don't execute any extended work */
if (pollset->shutting_down) { if (pollset->shutting_down) {
GPR_TIMER_MARK("grpc_pollset_work.shutting_down", 0); GPR_TIMER_MARK("pollset_work.shutting_down", 0);
goto done; goto done;
} }
/* Give do_promote priority so we don't starve it out */ /* Give do_promote priority so we don't starve it out */
if (pollset->in_flight_cbs) { if (pollset->in_flight_cbs) {
GPR_TIMER_MARK("grpc_pollset_work.in_flight_cbs", 0); GPR_TIMER_MARK("pollset_work.in_flight_cbs", 0);
gpr_mu_unlock(pollset->mu); gpr_mu_unlock(pollset->mu);
locked = 0; locked = 0;
goto done; goto done;
@ -962,7 +958,7 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
locked = 0; locked = 0;
gpr_tls_set(&g_current_thread_poller, 0); gpr_tls_set(&g_current_thread_poller, 0);
} else { } else {
GPR_TIMER_MARK("grpc_pollset_work.kicked_without_pollers", 0); GPR_TIMER_MARK("pollset_work.kicked_without_pollers", 0);
pollset->kicked_without_pollers = 0; pollset->kicked_without_pollers = 0;
} }
/* Finished execution - start cleaning up. /* Finished execution - start cleaning up.
@ -975,7 +971,7 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
gpr_mu_lock(pollset->mu); gpr_mu_lock(pollset->mu);
locked = 1; locked = 1;
} }
/* If we're forced to re-evaluate polling (via grpc_pollset_kick with /* If we're forced to re-evaluate polling (via pollset_kick with
GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) then we land here and force GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) then we land here and force
a loop */ a loop */
if (worker.reevaluate_polling_on_wakeup) { if (worker.reevaluate_polling_on_wakeup) {
@ -998,8 +994,8 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
pollset->local_wakeup_cache = worker.wakeup_fd; pollset->local_wakeup_cache = worker.wakeup_fd;
/* check shutdown conditions */ /* check shutdown conditions */
if (pollset->shutting_down) { if (pollset->shutting_down) {
if (grpc_pollset_has_workers(pollset)) { if (pollset_has_workers(pollset)) {
grpc_pollset_kick(pollset, NULL); pollset_kick(pollset, NULL);
} else if (!pollset->called_shutdown && pollset->in_flight_cbs == 0) { } else if (!pollset->called_shutdown && pollset->in_flight_cbs == 0) {
pollset->called_shutdown = 1; pollset->called_shutdown = 1;
gpr_mu_unlock(pollset->mu); gpr_mu_unlock(pollset->mu);
@ -1007,7 +1003,7 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_exec_ctx_flush(exec_ctx); grpc_exec_ctx_flush(exec_ctx);
/* Continuing to access pollset here is safe -- it is the caller's /* Continuing to access pollset here is safe -- it is the caller's
* responsibility to not destroy when it has outstanding calls to * responsibility to not destroy when it has outstanding calls to
* grpc_pollset_work. * pollset_work.
* TODO(dklempner): Can we refactor the shutdown logic to avoid this? */ * TODO(dklempner): Can we refactor the shutdown logic to avoid this? */
gpr_mu_lock(pollset->mu); gpr_mu_lock(pollset->mu);
} else if (!grpc_closure_list_empty(pollset->idle_jobs)) { } else if (!grpc_closure_list_empty(pollset->idle_jobs)) {
@ -1018,27 +1014,27 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
} }
} }
*worker_hdl = NULL; *worker_hdl = NULL;
GPR_TIMER_END("grpc_pollset_work", 0); GPR_TIMER_END("pollset_work", 0);
} }
void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, static void pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_closure *closure) { grpc_closure *closure) {
GPR_ASSERT(!pollset->shutting_down); GPR_ASSERT(!pollset->shutting_down);
pollset->shutting_down = 1; pollset->shutting_down = 1;
pollset->shutdown_done = closure; pollset->shutdown_done = closure;
grpc_pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST); pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
if (!grpc_pollset_has_workers(pollset)) { if (!pollset_has_workers(pollset)) {
grpc_exec_ctx_enqueue_list(exec_ctx, &pollset->idle_jobs, NULL); grpc_exec_ctx_enqueue_list(exec_ctx, &pollset->idle_jobs, NULL);
} }
if (!pollset->called_shutdown && pollset->in_flight_cbs == 0 && if (!pollset->called_shutdown && pollset->in_flight_cbs == 0 &&
!grpc_pollset_has_workers(pollset)) { !pollset_has_workers(pollset)) {
pollset->called_shutdown = 1; pollset->called_shutdown = 1;
finish_shutdown(exec_ctx, pollset); finish_shutdown(exec_ctx, pollset);
} }
} }
int grpc_poll_deadline_to_millis_timeout(gpr_timespec deadline, static int poll_deadline_to_millis_timeout(gpr_timespec deadline,
gpr_timespec now) { gpr_timespec now) {
gpr_timespec timeout; gpr_timespec timeout;
static const int64_t max_spin_polling_us = 10; static const int64_t max_spin_polling_us = 10;
if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) { if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) {
@ -1084,7 +1080,7 @@ static void basic_do_promote(grpc_exec_ctx *exec_ctx, void *args,
gpr_mu_lock(pollset->mu); gpr_mu_lock(pollset->mu);
/* First we need to ensure that nobody is polling concurrently */ /* First we need to ensure that nobody is polling concurrently */
GPR_ASSERT(!grpc_pollset_has_workers(pollset)); GPR_ASSERT(!pollset_has_workers(pollset));
gpr_free(up_args); gpr_free(up_args);
/* At this point the pollset may no longer be a unary poller. In that case /* At this point the pollset may no longer be a unary poller. In that case
@ -1099,7 +1095,7 @@ static void basic_do_promote(grpc_exec_ctx *exec_ctx, void *args,
pollset->called_shutdown = 1; pollset->called_shutdown = 1;
finish_shutdown(exec_ctx, pollset); finish_shutdown(exec_ctx, pollset);
} }
} else if (grpc_fd_is_orphaned(fd)) { } else if (fd_is_orphaned(fd)) {
/* Don't try to add it to anything, we'll drop our ref on it below */ /* Don't try to add it to anything, we'll drop our ref on it below */
} else if (pollset->vtable != original_vtable) { } else if (pollset->vtable != original_vtable) {
pollset->vtable->add_fd(exec_ctx, pollset, fd, 0); pollset->vtable->add_fd(exec_ctx, pollset, fd, 0);
@ -1108,9 +1104,8 @@ static void basic_do_promote(grpc_exec_ctx *exec_ctx, void *args,
fds[0] = pollset->data.ptr; fds[0] = pollset->data.ptr;
fds[1] = fd; fds[1] = fd;
if (fds[0] && !grpc_fd_is_orphaned(fds[0])) { if (fds[0] && !fd_is_orphaned(fds[0])) {
grpc_platform_become_multipoller(exec_ctx, pollset, fds, platform_become_multipoller(exec_ctx, pollset, fds, GPR_ARRAY_SIZE(fds));
GPR_ARRAY_SIZE(fds));
GRPC_FD_UNREF(fds[0], "basicpoll"); GRPC_FD_UNREF(fds[0], "basicpoll");
} else { } else {
/* old fd is orphaned and we haven't cleaned it up until now, so remain a /* old fd is orphaned and we haven't cleaned it up until now, so remain a
@ -1135,7 +1130,7 @@ static void basic_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
GPR_ASSERT(fd); GPR_ASSERT(fd);
if (fd == pollset->data.ptr) goto exit; if (fd == pollset->data.ptr) goto exit;
if (!grpc_pollset_has_workers(pollset)) { if (!pollset_has_workers(pollset)) {
/* Fast path -- no in flight cbs */ /* Fast path -- no in flight cbs */
/* TODO(klempner): Comment this out and fix any test failures or establish /* TODO(klempner): Comment this out and fix any test failures or establish
* they are due to timing issues */ * they are due to timing issues */
@ -1146,9 +1141,8 @@ static void basic_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
if (fds[0] == NULL) { if (fds[0] == NULL) {
pollset->data.ptr = fd; pollset->data.ptr = fd;
GRPC_FD_REF(fd, "basicpoll"); GRPC_FD_REF(fd, "basicpoll");
} else if (!grpc_fd_is_orphaned(fds[0])) { } else if (!fd_is_orphaned(fds[0])) {
grpc_platform_become_multipoller(exec_ctx, pollset, fds, platform_become_multipoller(exec_ctx, pollset, fds, GPR_ARRAY_SIZE(fds));
GPR_ARRAY_SIZE(fds));
GRPC_FD_UNREF(fds[0], "basicpoll"); GRPC_FD_UNREF(fds[0], "basicpoll");
} else { } else {
/* old fd is orphaned and we haven't cleaned it up until now, so remain a /* old fd is orphaned and we haven't cleaned it up until now, so remain a
@ -1172,7 +1166,7 @@ static void basic_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
up_args->promotion_closure.cb_arg = up_args; up_args->promotion_closure.cb_arg = up_args;
grpc_closure_list_add(&pollset->idle_jobs, &up_args->promotion_closure, 1); grpc_closure_list_add(&pollset->idle_jobs, &up_args->promotion_closure, 1);
grpc_pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST); pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
exit: exit:
if (and_unlock_pollset) { if (and_unlock_pollset) {
@ -1196,11 +1190,11 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx,
nfds_t nfds; nfds_t nfds;
fd = pollset->data.ptr; fd = pollset->data.ptr;
if (fd && grpc_fd_is_orphaned(fd)) { if (fd && fd_is_orphaned(fd)) {
GRPC_FD_UNREF(fd, "basicpoll"); GRPC_FD_UNREF(fd, "basicpoll");
fd = pollset->data.ptr = NULL; fd = pollset->data.ptr = NULL;
} }
timeout = grpc_poll_deadline_to_millis_timeout(deadline, now); timeout = poll_deadline_to_millis_timeout(deadline, now);
pfd[0].fd = GRPC_WAKEUP_FD_GET_READ_FD(&grpc_global_wakeup_fd); pfd[0].fd = GRPC_WAKEUP_FD_GET_READ_FD(&grpc_global_wakeup_fd);
pfd[0].events = POLLIN; pfd[0].events = POLLIN;
pfd[0].revents = 0; pfd[0].revents = 0;
@ -1213,8 +1207,8 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx,
pfd[2].revents = 0; pfd[2].revents = 0;
GRPC_FD_REF(fd, "basicpoll_begin"); GRPC_FD_REF(fd, "basicpoll_begin");
gpr_mu_unlock(pollset->mu); gpr_mu_unlock(pollset->mu);
pfd[2].events = (short)grpc_fd_begin_poll(fd, pollset, worker, POLLIN, pfd[2].events =
POLLOUT, &fd_watcher); (short)fd_begin_poll(fd, pollset, worker, POLLIN, POLLOUT, &fd_watcher);
if (pfd[2].events != 0) { if (pfd[2].events != 0) {
nfds++; nfds++;
} }
@ -1237,11 +1231,11 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx,
gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno)); gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno));
} }
if (fd) { if (fd) {
grpc_fd_end_poll(exec_ctx, &fd_watcher, 0, 0); fd_end_poll(exec_ctx, &fd_watcher, 0, 0);
} }
} else if (r == 0) { } else if (r == 0) {
if (fd) { if (fd) {
grpc_fd_end_poll(exec_ctx, &fd_watcher, 0, 0); fd_end_poll(exec_ctx, &fd_watcher, 0, 0);
} }
} else { } else {
if (pfd[0].revents & POLLIN_CHECK) { if (pfd[0].revents & POLLIN_CHECK) {
@ -1251,10 +1245,10 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx,
grpc_wakeup_fd_consume_wakeup(&worker->wakeup_fd->fd); grpc_wakeup_fd_consume_wakeup(&worker->wakeup_fd->fd);
} }
if (nfds > 2) { if (nfds > 2) {
grpc_fd_end_poll(exec_ctx, &fd_watcher, pfd[2].revents & POLLIN_CHECK, fd_end_poll(exec_ctx, &fd_watcher, pfd[2].revents & POLLIN_CHECK,
pfd[2].revents & POLLOUT_CHECK); pfd[2].revents & POLLOUT_CHECK);
} else if (fd) { } else if (fd) {
grpc_fd_end_poll(exec_ctx, &fd_watcher, 0, 0); fd_end_poll(exec_ctx, &fd_watcher, 0, 0);
} }
} }
@ -1286,6 +1280,8 @@ static void become_basic_pollset(grpc_pollset *pollset, grpc_fd *fd_or_null) {
* pollset_multipoller_with_poll_posix.c * pollset_multipoller_with_poll_posix.c
*/ */
#ifndef GPR_LINUX_MULTIPOLL_WITH_EPOLL
typedef struct { typedef struct {
/* all polled fds */ /* all polled fds */
size_t fd_count; size_t fd_count;
@ -1335,7 +1331,7 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
struct pollfd *pfds; struct pollfd *pfds;
h = pollset->data.ptr; h = pollset->data.ptr;
timeout = grpc_poll_deadline_to_millis_timeout(deadline, now); timeout = poll_deadline_to_millis_timeout(deadline, now);
/* TODO(ctiller): perform just one malloc here if we exceed the inline case */ /* TODO(ctiller): perform just one malloc here if we exceed the inline case */
pfds = gpr_malloc(sizeof(*pfds) * (h->fd_count + 2)); pfds = gpr_malloc(sizeof(*pfds) * (h->fd_count + 2));
watchers = gpr_malloc(sizeof(*watchers) * (h->fd_count + 2)); watchers = gpr_malloc(sizeof(*watchers) * (h->fd_count + 2));
@ -1348,7 +1344,7 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
pfds[1].events = POLLIN; pfds[1].events = POLLIN;
pfds[1].revents = 0; pfds[1].revents = 0;
for (i = 0; i < h->fd_count; i++) { for (i = 0; i < h->fd_count; i++) {
int remove = grpc_fd_is_orphaned(h->fds[i]); int remove = fd_is_orphaned(h->fds[i]);
for (j = 0; !remove && j < h->del_count; j++) { for (j = 0; !remove && j < h->del_count; j++) {
if (h->fds[i] == h->dels[j]) remove = 1; if (h->fds[i] == h->dels[j]) remove = 1;
} }
@ -1370,8 +1366,8 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
gpr_mu_unlock(pollset->mu); gpr_mu_unlock(pollset->mu);
for (i = 2; i < pfd_count; i++) { for (i = 2; i < pfd_count; i++) {
pfds[i].events = (short)grpc_fd_begin_poll(watchers[i].fd, pollset, worker, pfds[i].events = (short)fd_begin_poll(watchers[i].fd, pollset, worker,
POLLIN, POLLOUT, &watchers[i]); POLLIN, POLLOUT, &watchers[i]);
} }
/* TODO(vpai): Consider first doing a 0 timeout poll here to avoid /* TODO(vpai): Consider first doing a 0 timeout poll here to avoid
@ -1385,11 +1381,11 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno)); gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno));
} }
for (i = 2; i < pfd_count; i++) { for (i = 2; i < pfd_count; i++) {
grpc_fd_end_poll(exec_ctx, &watchers[i], 0, 0); fd_end_poll(exec_ctx, &watchers[i], 0, 0);
} }
} else if (r == 0) { } else if (r == 0) {
for (i = 2; i < pfd_count; i++) { for (i = 2; i < pfd_count; i++) {
grpc_fd_end_poll(exec_ctx, &watchers[i], 0, 0); fd_end_poll(exec_ctx, &watchers[i], 0, 0);
} }
} else { } else {
if (pfds[0].revents & POLLIN_CHECK) { if (pfds[0].revents & POLLIN_CHECK) {
@ -1400,11 +1396,11 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
} }
for (i = 2; i < pfd_count; i++) { for (i = 2; i < pfd_count; i++) {
if (watchers[i].fd == NULL) { if (watchers[i].fd == NULL) {
grpc_fd_end_poll(exec_ctx, &watchers[i], 0, 0); fd_end_poll(exec_ctx, &watchers[i], 0, 0);
continue; continue;
} }
grpc_fd_end_poll(exec_ctx, &watchers[i], pfds[i].revents & POLLIN_CHECK, fd_end_poll(exec_ctx, &watchers[i], pfds[i].revents & POLLIN_CHECK,
pfds[i].revents & POLLOUT_CHECK); pfds[i].revents & POLLOUT_CHECK);
} }
} }
@ -1439,9 +1435,9 @@ static const grpc_pollset_vtable multipoll_with_poll_pollset = {
multipoll_with_poll_pollset_finish_shutdown, multipoll_with_poll_pollset_finish_shutdown,
multipoll_with_poll_pollset_destroy}; multipoll_with_poll_pollset_destroy};
void grpc_poll_become_multipoller(grpc_exec_ctx *exec_ctx, static void poll_become_multipoller(grpc_exec_ctx *exec_ctx,
grpc_pollset *pollset, grpc_fd **fds, grpc_pollset *pollset, grpc_fd **fds,
size_t nfds) { size_t nfds) {
size_t i; size_t i;
poll_hdr *h = gpr_malloc(sizeof(poll_hdr)); poll_hdr *h = gpr_malloc(sizeof(poll_hdr));
pollset->vtable = &multipoll_with_poll_pollset; pollset->vtable = &multipoll_with_poll_pollset;
@ -1458,6 +1454,8 @@ void grpc_poll_become_multipoller(grpc_exec_ctx *exec_ctx,
} }
} }
#endif /* !GPR_LINUX_MULTIPOLL_WITH_EPOLL */
/******************************************************************************* /*******************************************************************************
* pollset_multipoller_with_epoll_posix.c * pollset_multipoller_with_epoll_posix.c
*/ */
@ -1518,7 +1516,7 @@ static void remove_epoll_fd_from_global_list(int epoll_fd) {
gpr_mu_unlock(&epoll_fd_list_mu); gpr_mu_unlock(&epoll_fd_list_mu);
} }
void grpc_remove_fd_from_all_epoll_sets(int fd) { static void remove_fd_from_all_epoll_sets(int fd) {
int err; int err;
gpr_once_init(&init_epoll_fd_list_mu, init_mu); gpr_once_init(&init_epoll_fd_list_mu, init_mu);
gpr_mu_lock(&epoll_fd_list_mu); gpr_mu_lock(&epoll_fd_list_mu);
@ -1554,7 +1552,7 @@ static void finally_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
/* We pretend to be polling whilst adding an fd to keep the fd from being /* We pretend to be polling whilst adding an fd to keep the fd from being
closed during the add. This may result in a spurious wakeup being assigned closed during the add. This may result in a spurious wakeup being assigned
to this pollset whilst adding, but that should be benign. */ to this pollset whilst adding, but that should be benign. */
GPR_ASSERT(grpc_fd_begin_poll(fd, pollset, NULL, 0, 0, &watcher) == 0); GPR_ASSERT(fd_begin_poll(fd, pollset, NULL, 0, 0, &watcher) == 0);
if (watcher.fd != NULL) { if (watcher.fd != NULL) {
ev.events = (uint32_t)(EPOLLIN | EPOLLOUT | EPOLLET); ev.events = (uint32_t)(EPOLLIN | EPOLLOUT | EPOLLET);
ev.data.ptr = fd; ev.data.ptr = fd;
@ -1567,14 +1565,14 @@ static void finally_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
} }
} }
} }
grpc_fd_end_poll(exec_ctx, &watcher, 0, 0); fd_end_poll(exec_ctx, &watcher, 0, 0);
} }
static void perform_delayed_add(grpc_exec_ctx *exec_ctx, void *arg, static void perform_delayed_add(grpc_exec_ctx *exec_ctx, void *arg,
bool iomgr_status) { bool iomgr_status) {
delayed_add *da = arg; delayed_add *da = arg;
if (!grpc_fd_is_orphaned(da->fd)) { if (!fd_is_orphaned(da->fd)) {
finally_add_fd(exec_ctx, da->pollset, da->fd); finally_add_fd(exec_ctx, da->pollset, da->fd);
} }
@ -1633,7 +1631,7 @@ static void multipoll_with_epoll_pollset_maybe_work_and_unlock(
gpr_mu_unlock(pollset->mu); gpr_mu_unlock(pollset->mu);
timeout_ms = grpc_poll_deadline_to_millis_timeout(deadline, now); timeout_ms = poll_deadline_to_millis_timeout(deadline, now);
pfds[0].fd = GRPC_WAKEUP_FD_GET_READ_FD(&worker->wakeup_fd->fd); pfds[0].fd = GRPC_WAKEUP_FD_GET_READ_FD(&worker->wakeup_fd->fd);
pfds[0].events = POLLIN; pfds[0].events = POLLIN;
@ -1681,10 +1679,10 @@ static void multipoll_with_epoll_pollset_maybe_work_and_unlock(
grpc_wakeup_fd_consume_wakeup(&grpc_global_wakeup_fd); grpc_wakeup_fd_consume_wakeup(&grpc_global_wakeup_fd);
} else { } else {
if (read_ev || cancel) { if (read_ev || cancel) {
grpc_fd_become_readable(exec_ctx, fd); fd_become_readable(exec_ctx, fd);
} }
if (write_ev || cancel) { if (write_ev || cancel) {
grpc_fd_become_writable(exec_ctx, fd); fd_become_writable(exec_ctx, fd);
} }
} }
} }
@ -1743,12 +1741,9 @@ static void epoll_become_multipoller(grpc_exec_ctx *exec_ctx,
} }
} }
grpc_platform_become_multipoller_type grpc_platform_become_multipoller =
epoll_become_multipoller;
#else /* GPR_LINUX_MULTIPOLL_WITH_EPOLL */ #else /* GPR_LINUX_MULTIPOLL_WITH_EPOLL */
void grpc_remove_fd_from_all_epoll_sets(int fd) {} static void remove_fd_from_all_epoll_sets(int fd) {}
#endif /* GPR_LINUX_MULTIPOLL_WITH_EPOLL */ #endif /* GPR_LINUX_MULTIPOLL_WITH_EPOLL */
@ -1756,14 +1751,14 @@ void grpc_remove_fd_from_all_epoll_sets(int fd) {}
* pollset_set_posix.c * pollset_set_posix.c
*/ */
grpc_pollset_set *grpc_pollset_set_create(void) { static grpc_pollset_set *pollset_set_create(void) {
grpc_pollset_set *pollset_set = gpr_malloc(sizeof(*pollset_set)); grpc_pollset_set *pollset_set = gpr_malloc(sizeof(*pollset_set));
memset(pollset_set, 0, sizeof(*pollset_set)); memset(pollset_set, 0, sizeof(*pollset_set));
gpr_mu_init(&pollset_set->mu); gpr_mu_init(&pollset_set->mu);
return pollset_set; return pollset_set;
} }
void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set) { static void pollset_set_destroy(grpc_pollset_set *pollset_set) {
size_t i; size_t i;
gpr_mu_destroy(&pollset_set->mu); gpr_mu_destroy(&pollset_set->mu);
for (i = 0; i < pollset_set->fd_count; i++) { for (i = 0; i < pollset_set->fd_count; i++) {
@ -1775,9 +1770,9 @@ void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set) {
gpr_free(pollset_set); gpr_free(pollset_set);
} }
void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx, static void pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_pollset_set *pollset_set,
grpc_pollset *pollset) { grpc_pollset *pollset) {
size_t i, j; size_t i, j;
gpr_mu_lock(&pollset_set->mu); gpr_mu_lock(&pollset_set->mu);
if (pollset_set->pollset_count == pollset_set->pollset_capacity) { if (pollset_set->pollset_count == pollset_set->pollset_capacity) {
@ -1789,10 +1784,10 @@ void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
} }
pollset_set->pollsets[pollset_set->pollset_count++] = pollset; pollset_set->pollsets[pollset_set->pollset_count++] = pollset;
for (i = 0, j = 0; i < pollset_set->fd_count; i++) { for (i = 0, j = 0; i < pollset_set->fd_count; i++) {
if (grpc_fd_is_orphaned(pollset_set->fds[i])) { if (fd_is_orphaned(pollset_set->fds[i])) {
GRPC_FD_UNREF(pollset_set->fds[i], "pollset_set"); GRPC_FD_UNREF(pollset_set->fds[i], "pollset_set");
} else { } else {
grpc_pollset_add_fd(exec_ctx, pollset, pollset_set->fds[i]); pollset_add_fd(exec_ctx, pollset, pollset_set->fds[i]);
pollset_set->fds[j++] = pollset_set->fds[i]; pollset_set->fds[j++] = pollset_set->fds[i];
} }
} }
@ -1800,9 +1795,9 @@ void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
gpr_mu_unlock(&pollset_set->mu); gpr_mu_unlock(&pollset_set->mu);
} }
void grpc_pollset_set_del_pollset(grpc_exec_ctx *exec_ctx, static void pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_pollset_set *pollset_set,
grpc_pollset *pollset) { grpc_pollset *pollset) {
size_t i; size_t i;
gpr_mu_lock(&pollset_set->mu); gpr_mu_lock(&pollset_set->mu);
for (i = 0; i < pollset_set->pollset_count; i++) { for (i = 0; i < pollset_set->pollset_count; i++) {
@ -1816,9 +1811,9 @@ void grpc_pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
gpr_mu_unlock(&pollset_set->mu); gpr_mu_unlock(&pollset_set->mu);
} }
void grpc_pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx, static void pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag, grpc_pollset_set *bag,
grpc_pollset_set *item) { grpc_pollset_set *item) {
size_t i, j; size_t i, j;
gpr_mu_lock(&bag->mu); gpr_mu_lock(&bag->mu);
if (bag->pollset_set_count == bag->pollset_set_capacity) { if (bag->pollset_set_count == bag->pollset_set_capacity) {
@ -1829,10 +1824,10 @@ void grpc_pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
} }
bag->pollset_sets[bag->pollset_set_count++] = item; bag->pollset_sets[bag->pollset_set_count++] = item;
for (i = 0, j = 0; i < bag->fd_count; i++) { for (i = 0, j = 0; i < bag->fd_count; i++) {
if (grpc_fd_is_orphaned(bag->fds[i])) { if (fd_is_orphaned(bag->fds[i])) {
GRPC_FD_UNREF(bag->fds[i], "pollset_set"); GRPC_FD_UNREF(bag->fds[i], "pollset_set");
} else { } else {
grpc_pollset_set_add_fd(exec_ctx, item, bag->fds[i]); pollset_set_add_fd(exec_ctx, item, bag->fds[i]);
bag->fds[j++] = bag->fds[i]; bag->fds[j++] = bag->fds[i];
} }
} }
@ -1840,9 +1835,9 @@ void grpc_pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
gpr_mu_unlock(&bag->mu); gpr_mu_unlock(&bag->mu);
} }
void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx, static void pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag, grpc_pollset_set *bag,
grpc_pollset_set *item) { grpc_pollset_set *item) {
size_t i; size_t i;
gpr_mu_lock(&bag->mu); gpr_mu_lock(&bag->mu);
for (i = 0; i < bag->pollset_set_count; i++) { for (i = 0; i < bag->pollset_set_count; i++) {
@ -1856,8 +1851,8 @@ void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
gpr_mu_unlock(&bag->mu); gpr_mu_unlock(&bag->mu);
} }
void grpc_pollset_set_add_fd(grpc_exec_ctx *exec_ctx, static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_fd *fd) { grpc_pollset_set *pollset_set, grpc_fd *fd) {
size_t i; size_t i;
gpr_mu_lock(&pollset_set->mu); gpr_mu_lock(&pollset_set->mu);
if (pollset_set->fd_count == pollset_set->fd_capacity) { if (pollset_set->fd_count == pollset_set->fd_capacity) {
@ -1868,16 +1863,16 @@ void grpc_pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
GRPC_FD_REF(fd, "pollset_set"); GRPC_FD_REF(fd, "pollset_set");
pollset_set->fds[pollset_set->fd_count++] = fd; pollset_set->fds[pollset_set->fd_count++] = fd;
for (i = 0; i < pollset_set->pollset_count; i++) { for (i = 0; i < pollset_set->pollset_count; i++) {
grpc_pollset_add_fd(exec_ctx, pollset_set->pollsets[i], fd); pollset_add_fd(exec_ctx, pollset_set->pollsets[i], fd);
} }
for (i = 0; i < pollset_set->pollset_set_count; i++) { for (i = 0; i < pollset_set->pollset_set_count; i++) {
grpc_pollset_set_add_fd(exec_ctx, pollset_set->pollset_sets[i], fd); pollset_set_add_fd(exec_ctx, pollset_set->pollset_sets[i], fd);
} }
gpr_mu_unlock(&pollset_set->mu); gpr_mu_unlock(&pollset_set->mu);
} }
void grpc_pollset_set_del_fd(grpc_exec_ctx *exec_ctx, static void pollset_set_del_fd(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_fd *fd) { grpc_pollset_set *pollset_set, grpc_fd *fd) {
size_t i; size_t i;
gpr_mu_lock(&pollset_set->mu); gpr_mu_lock(&pollset_set->mu);
for (i = 0; i < pollset_set->fd_count; i++) { for (i = 0; i < pollset_set->fd_count; i++) {
@ -1890,9 +1885,61 @@ void grpc_pollset_set_del_fd(grpc_exec_ctx *exec_ctx,
} }
} }
for (i = 0; i < pollset_set->pollset_set_count; i++) { for (i = 0; i < pollset_set->pollset_set_count; i++) {
grpc_pollset_set_del_fd(exec_ctx, pollset_set->pollset_sets[i], fd); pollset_set_del_fd(exec_ctx, pollset_set->pollset_sets[i], fd);
} }
gpr_mu_unlock(&pollset_set->mu); gpr_mu_unlock(&pollset_set->mu);
} }
/*******************************************************************************
* event engine binding
*/
static void shutdown_engine(void) {
fd_global_shutdown();
pollset_global_shutdown();
}
static const grpc_event_engine_vtable vtable = {
.pollset_size = sizeof(grpc_pollset),
.fd_create = fd_create,
.fd_wrapped_fd = fd_wrapped_fd,
.fd_orphan = fd_orphan,
.fd_shutdown = fd_shutdown,
.fd_notify_on_read = fd_notify_on_read,
.fd_notify_on_write = fd_notify_on_write,
.pollset_init = pollset_init,
.pollset_shutdown = pollset_shutdown,
.pollset_reset = pollset_reset,
.pollset_destroy = pollset_destroy,
.pollset_work = pollset_work,
.pollset_kick = pollset_kick,
.pollset_add_fd = pollset_add_fd,
.pollset_set_create = pollset_set_create,
.pollset_set_destroy = pollset_set_destroy,
.pollset_set_add_pollset = pollset_set_add_pollset,
.pollset_set_del_pollset = pollset_set_del_pollset,
.pollset_set_add_pollset_set = pollset_set_add_pollset_set,
.pollset_set_del_pollset_set = pollset_set_del_pollset_set,
.pollset_set_add_fd = pollset_set_add_fd,
.pollset_set_del_fd = pollset_set_del_fd,
.kick_poller = kick_poller,
.shutdown_engine = shutdown_engine,
};
const grpc_event_engine_vtable *grpc_init_poll_and_epoll_posix(void) {
#ifdef GPR_LINUX_MULTIPOLL_WITH_EPOLL
platform_become_multipoller = epoll_become_multipoller;
#else
platform_become_multipoller = poll_become_multipoller;
#endif
fd_global_init();
pollset_global_init();
return &vtable;
}
#endif #endif

@ -36,4 +36,6 @@
#include "src/core/iomgr/ev_posix.h" #include "src/core/iomgr/ev_posix.h"
const grpc_event_engine_vtable *grpc_init_poll_and_epoll_posix(void);
#endif // GRPC_INTERNAL_CORE_IOMGR_EV_POLL_AND_EPOLL_POSIX_H #endif // GRPC_INTERNAL_CORE_IOMGR_EV_POLL_AND_EPOLL_POSIX_H

@ -30,3 +30,127 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#include "src/core/iomgr/ev_posix.h"
#include <grpc/support/log.h>
#include "src/core/iomgr/ev_poll_and_epoll_posix.h"
static const grpc_event_engine_vtable *g_event_engine;
void grpc_event_engine_init(void) {
if ((g_event_engine = grpc_init_poll_and_epoll_posix())) {
return;
}
gpr_log(GPR_ERROR, "No event engine could be initialized");
abort();
}
void grpc_event_engine_shutdown(void) { g_event_engine->shutdown_engine(); }
grpc_fd *grpc_fd_create(int fd, const char *name) {
return g_event_engine->fd_create(fd, name);
}
int grpc_fd_wrapped_fd(grpc_fd *fd) {
return g_event_engine->fd_wrapped_fd(fd);
}
void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
int *release_fd, const char *reason) {
g_event_engine->fd_orphan(exec_ctx, fd, on_done, release_fd, reason);
}
void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
g_event_engine->fd_shutdown(exec_ctx, fd);
}
void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *closure) {
g_event_engine->fd_notify_on_read(exec_ctx, fd, closure);
}
void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *closure) {
g_event_engine->fd_notify_on_write(exec_ctx, fd, closure);
}
size_t grpc_pollset_size(void) { return g_event_engine->pollset_size; }
void grpc_pollset_init(grpc_pollset *pollset, gpr_mu *mu) {
g_event_engine->pollset_init(pollset, mu);
}
void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_closure *closure) {
g_event_engine->pollset_shutdown(exec_ctx, pollset, closure);
}
void grpc_pollset_reset(grpc_pollset *pollset) {
g_event_engine->pollset_reset(pollset);
}
void grpc_pollset_destroy(grpc_pollset *pollset) {
g_event_engine->pollset_destroy(pollset);
}
void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_pollset_worker **worker, gpr_timespec now,
gpr_timespec deadline) {
g_event_engine->pollset_work(exec_ctx, pollset, worker, now, deadline);
}
void grpc_pollset_kick(grpc_pollset *pollset,
grpc_pollset_worker *specific_worker) {
g_event_engine->pollset_kick(pollset, specific_worker);
}
void grpc_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
struct grpc_fd *fd) {
g_event_engine->pollset_add_fd(exec_ctx, pollset, fd);
}
grpc_pollset_set *grpc_pollset_set_create(void) {
return g_event_engine->pollset_set_create();
}
void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set) {
g_event_engine->pollset_set_destroy(pollset_set);
}
void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set,
grpc_pollset *pollset) {
g_event_engine->pollset_set_add_pollset(exec_ctx, pollset_set, pollset);
}
void grpc_pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set,
grpc_pollset *pollset) {
g_event_engine->pollset_set_del_pollset(exec_ctx, pollset_set, pollset);
}
void grpc_pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag,
grpc_pollset_set *item) {
g_event_engine->pollset_set_add_pollset_set(exec_ctx, bag, item);
}
void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag,
grpc_pollset_set *item) {
g_event_engine->pollset_set_del_pollset_set(exec_ctx, bag, item);
}
void grpc_pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_fd *fd) {
g_event_engine->pollset_set_add_fd(exec_ctx, pollset_set, fd);
}
void grpc_pollset_set_del_fd(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_fd *fd) {
g_event_engine->pollset_set_del_fd(exec_ctx, pollset_set, fd);
}
void grpc_kick_poller(void) { g_event_engine->kick_poller(); }

@ -63,9 +63,32 @@ typedef struct grpc_event_engine_vtable {
gpr_timespec deadline); gpr_timespec deadline);
void (*pollset_kick)(grpc_pollset *pollset, void (*pollset_kick)(grpc_pollset *pollset,
grpc_pollset_worker *specific_worker); grpc_pollset_worker *specific_worker);
} grpc_event_engine_vtable; void (*pollset_add_fd)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
struct grpc_fd *fd);
extern const grpc_event_engine_vtable *grpc_event_engine; grpc_pollset_set *(*pollset_set_create)(void);
void (*pollset_set_destroy)(grpc_pollset_set *pollset_set);
void (*pollset_set_add_pollset)(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set,
grpc_pollset *pollset);
void (*pollset_set_del_pollset)(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set,
grpc_pollset *pollset);
void (*pollset_set_add_pollset_set)(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag,
grpc_pollset_set *item);
void (*pollset_set_del_pollset_set)(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag,
grpc_pollset_set *item);
void (*pollset_set_add_fd)(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_fd *fd);
void (*pollset_set_del_fd)(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set, grpc_fd *fd);
void (*kick_poller)(void);
void (*shutdown_engine)(void);
} grpc_event_engine_vtable;
void grpc_event_engine_init(void); void grpc_event_engine_init(void);
void grpc_event_engine_shutdown(void); void grpc_event_engine_shutdown(void);

@ -59,7 +59,6 @@ void grpc_iomgr_init(void) {
g_root_object.next = g_root_object.prev = &g_root_object; g_root_object.next = g_root_object.prev = &g_root_object;
g_root_object.name = "root"; g_root_object.name = "root";
grpc_iomgr_platform_init(); grpc_iomgr_platform_init();
grpc_pollset_global_init();
} }
static size_t count_objects(void) { static size_t count_objects(void) {
@ -131,7 +130,6 @@ void grpc_iomgr_shutdown(void) {
gpr_mu_lock(&g_mu); gpr_mu_lock(&g_mu);
gpr_mu_unlock(&g_mu); gpr_mu_unlock(&g_mu);
grpc_pollset_global_shutdown();
grpc_iomgr_platform_shutdown(); grpc_iomgr_platform_shutdown();
gpr_mu_destroy(&g_mu); gpr_mu_destroy(&g_mu);
gpr_cv_destroy(&g_rcv); gpr_cv_destroy(&g_rcv);

@ -34,8 +34,8 @@
#ifndef GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H #ifndef GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H
#define GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H #define GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H
#include "src/core/iomgr/iomgr.h"
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "src/core/iomgr/iomgr.h"
typedef struct grpc_iomgr_object { typedef struct grpc_iomgr_object {
char *name; char *name;
@ -43,9 +43,6 @@ typedef struct grpc_iomgr_object {
struct grpc_iomgr_object *prev; struct grpc_iomgr_object *prev;
} grpc_iomgr_object; } grpc_iomgr_object;
void grpc_pollset_global_init(void);
void grpc_pollset_global_shutdown(void);
void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name); void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name);
void grpc_iomgr_unregister_object(grpc_iomgr_object *obj); void grpc_iomgr_unregister_object(grpc_iomgr_object *obj);

@ -35,6 +35,7 @@
#define GRPC_INTERNAL_CORE_IOMGR_UDP_SERVER_H #define GRPC_INTERNAL_CORE_IOMGR_UDP_SERVER_H
#include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/endpoint.h"
#include "src/core/iomgr/ev_posix.h"
/* Forward decl of grpc_server */ /* Forward decl of grpc_server */
typedef struct grpc_server grpc_server; typedef struct grpc_server grpc_server;

@ -238,12 +238,12 @@ static grpc_end2end_test_fixture chttp2_create_fixture_micro_fullstack(
} }
grpc_connectivity_state g_state = GRPC_CHANNEL_IDLE; grpc_connectivity_state g_state = GRPC_CHANNEL_IDLE;
grpc_pollset_set g_interested_parties; grpc_pollset_set *g_interested_parties;
static void state_changed(grpc_exec_ctx *exec_ctx, void *arg, bool success) { static void state_changed(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
if (g_state != GRPC_CHANNEL_READY) { if (g_state != GRPC_CHANNEL_READY) {
grpc_subchannel_notify_on_state_change( grpc_subchannel_notify_on_state_change(
exec_ctx, arg, &g_interested_parties, &g_state, exec_ctx, arg, g_interested_parties, &g_state,
grpc_closure_create(state_changed, arg)); grpc_closure_create(state_changed, arg));
} }
} }
@ -258,9 +258,9 @@ static grpc_connected_subchannel *connect_subchannel(grpc_subchannel *c) {
grpc_pollset *pollset = gpr_malloc(grpc_pollset_size()); grpc_pollset *pollset = gpr_malloc(grpc_pollset_size());
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_pollset_init(pollset, &mu); grpc_pollset_init(pollset, &mu);
grpc_pollset_set_init(&g_interested_parties); g_interested_parties = grpc_pollset_set_create();
grpc_pollset_set_add_pollset(&exec_ctx, &g_interested_parties, pollset); grpc_pollset_set_add_pollset(&exec_ctx, g_interested_parties, pollset);
grpc_subchannel_notify_on_state_change(&exec_ctx, c, &g_interested_parties, grpc_subchannel_notify_on_state_change(&exec_ctx, c, g_interested_parties,
&g_state, &g_state,
grpc_closure_create(state_changed, c)); grpc_closure_create(state_changed, c));
grpc_exec_ctx_flush(&exec_ctx); grpc_exec_ctx_flush(&exec_ctx);
@ -275,7 +275,7 @@ static grpc_connected_subchannel *connect_subchannel(grpc_subchannel *c) {
} }
grpc_pollset_shutdown(&exec_ctx, pollset, grpc_pollset_shutdown(&exec_ctx, pollset,
grpc_closure_create(destroy_pollset, pollset)); grpc_closure_create(destroy_pollset, pollset));
grpc_pollset_set_destroy(&g_interested_parties); grpc_pollset_set_destroy(g_interested_parties);
gpr_mu_unlock(&mu); gpr_mu_unlock(&mu);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
gpr_free(pollset); gpr_free(pollset);

@ -53,12 +53,8 @@ END2END_FIXTURES = {
'h2_census': default_unsecure_fixture_options, 'h2_census': default_unsecure_fixture_options,
'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False), 'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False),
'h2_full': default_unsecure_fixture_options, 'h2_full': default_unsecure_fixture_options,
'h2_full+poll': default_unsecure_fixture_options._replace(
platforms=['linux']),
'h2_full+pipe': default_unsecure_fixture_options._replace( 'h2_full+pipe': default_unsecure_fixture_options._replace(
platforms=['linux']), platforms=['linux']),
'h2_full+poll+pipe': default_unsecure_fixture_options._replace(
platforms=['linux']),
'h2_oauth2': default_secure_fixture_options._replace(ci_mac=False), 'h2_oauth2': default_secure_fixture_options._replace(ci_mac=False),
'h2_proxy': default_unsecure_fixture_options._replace(includes_proxy=True, 'h2_proxy': default_unsecure_fixture_options._replace(includes_proxy=True,
ci_mac=False), ci_mac=False),
@ -68,11 +64,9 @@ END2END_FIXTURES = {
'h2_sockpair+trace': socketpair_unsecure_fixture_options._replace( 'h2_sockpair+trace': socketpair_unsecure_fixture_options._replace(
tracing=True), tracing=True),
'h2_ssl': default_secure_fixture_options, 'h2_ssl': default_secure_fixture_options,
'h2_ssl+poll': default_secure_fixture_options._replace(platforms=['linux']),
'h2_ssl_proxy': default_secure_fixture_options._replace(includes_proxy=True, 'h2_ssl_proxy': default_secure_fixture_options._replace(includes_proxy=True,
ci_mac=False), ci_mac=False),
'h2_uchannel': default_unsecure_fixture_options._replace(fullstack=False), 'h2_uchannel': default_unsecure_fixture_options._replace(fullstack=False),
'h2_uds+poll': uds_fixture_options._replace(platforms=['linux']),
'h2_uds': uds_fixture_options, 'h2_uds': uds_fixture_options,
} }

@ -50,7 +50,7 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/iomgr/pollset_posix.h" #include "src/core/iomgr/iomgr.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static gpr_mu g_mu; static gpr_mu g_mu;
@ -134,7 +134,7 @@ static void session_shutdown_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */
static void session_read_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */ static void session_read_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */
bool success) { bool success) {
session *se = arg; session *se = arg;
int fd = se->em_fd->fd; int fd = grpc_fd_wrapped_fd(se->em_fd);
ssize_t read_once = 0; ssize_t read_once = 0;
ssize_t read_total = 0; ssize_t read_total = 0;
@ -204,7 +204,7 @@ static void listen_cb(grpc_exec_ctx *exec_ctx, void *arg, /*=sv_arg*/
return; return;
} }
fd = accept(listen_em_fd->fd, (struct sockaddr *)&ss, &slen); fd = accept(grpc_fd_wrapped_fd(listen_em_fd), (struct sockaddr *)&ss, &slen);
GPR_ASSERT(fd >= 0); GPR_ASSERT(fd >= 0);
GPR_ASSERT(fd < FD_SETSIZE); GPR_ASSERT(fd < FD_SETSIZE);
flags = fcntl(fd, F_GETFL, 0); flags = fcntl(fd, F_GETFL, 0);
@ -306,7 +306,7 @@ static void client_session_shutdown_cb(grpc_exec_ctx *exec_ctx,
static void client_session_write(grpc_exec_ctx *exec_ctx, void *arg, /*client */ static void client_session_write(grpc_exec_ctx *exec_ctx, void *arg, /*client */
bool success) { bool success) {
client *cl = arg; client *cl = arg;
int fd = cl->em_fd->fd; int fd = grpc_fd_wrapped_fd(cl->em_fd);
ssize_t write_once = 0; ssize_t write_once = 0;
if (!success) { if (!success) {

@ -45,11 +45,12 @@
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/iomgr/iomgr.h" #include "src/core/iomgr/iomgr.h"
#include "src/core/iomgr/pollset_set.h"
#include "src/core/iomgr/socket_utils_posix.h" #include "src/core/iomgr/socket_utils_posix.h"
#include "src/core/iomgr/timer.h" #include "src/core/iomgr/timer.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static grpc_pollset_set g_pollset_set; static grpc_pollset_set *g_pollset_set;
static gpr_mu g_mu; static gpr_mu g_mu;
static grpc_pollset *g_pollset; static grpc_pollset *g_pollset;
static int g_connections_complete = 0; static int g_connections_complete = 0;
@ -108,7 +109,7 @@ void test_succeeds(void) {
/* connect to it */ /* connect to it */
GPR_ASSERT(getsockname(svr_fd, (struct sockaddr *)&addr, &addr_len) == 0); GPR_ASSERT(getsockname(svr_fd, (struct sockaddr *)&addr, &addr_len) == 0);
grpc_closure_init(&done, must_succeed, NULL); grpc_closure_init(&done, must_succeed, NULL);
grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, &g_pollset_set, grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set,
(struct sockaddr *)&addr, addr_len, (struct sockaddr *)&addr, addr_len,
gpr_inf_future(GPR_CLOCK_REALTIME)); gpr_inf_future(GPR_CLOCK_REALTIME));
@ -155,7 +156,7 @@ void test_fails(void) {
/* connect to a broken address */ /* connect to a broken address */
grpc_closure_init(&done, must_fail, NULL); grpc_closure_init(&done, must_fail, NULL);
grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, &g_pollset_set, grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set,
(struct sockaddr *)&addr, addr_len, (struct sockaddr *)&addr, addr_len,
gpr_inf_future(GPR_CLOCK_REALTIME)); gpr_inf_future(GPR_CLOCK_REALTIME));
@ -224,7 +225,7 @@ void test_times_out(void) {
gpr_mu_unlock(&g_mu); gpr_mu_unlock(&g_mu);
grpc_closure_init(&done, must_fail, NULL); grpc_closure_init(&done, must_fail, NULL);
grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, &g_pollset_set, grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set,
(struct sockaddr *)&addr, addr_len, connect_deadline); (struct sockaddr *)&addr, addr_len, connect_deadline);
/* Make sure the event doesn't trigger early */ /* Make sure the event doesn't trigger early */
@ -279,17 +280,17 @@ int main(int argc, char **argv) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_test_init(argc, argv); grpc_test_init(argc, argv);
grpc_init(); grpc_init();
grpc_pollset_set_init(&g_pollset_set); g_pollset_set = grpc_pollset_set_create();
g_pollset = gpr_malloc(grpc_pollset_size()); g_pollset = gpr_malloc(grpc_pollset_size());
gpr_mu_init(&g_mu); gpr_mu_init(&g_mu);
grpc_pollset_init(g_pollset, &g_mu); grpc_pollset_init(g_pollset, &g_mu);
grpc_pollset_set_add_pollset(&exec_ctx, &g_pollset_set, g_pollset); grpc_pollset_set_add_pollset(&exec_ctx, g_pollset_set, g_pollset);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
test_succeeds(); test_succeeds();
gpr_log(GPR_ERROR, "End of first test"); gpr_log(GPR_ERROR, "End of first test");
test_fails(); test_fails();
test_times_out(); test_times_out();
grpc_pollset_set_destroy(&g_pollset_set); grpc_pollset_set_destroy(g_pollset_set);
grpc_closure_init(&destroyed, destroy_pollset, g_pollset); grpc_closure_init(&destroyed, destroy_pollset, g_pollset);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);

@ -821,7 +821,6 @@ src/core/iomgr/iomgr_internal.h \
src/core/iomgr/iomgr_posix.h \ src/core/iomgr/iomgr_posix.h \
src/core/iomgr/pollset.h \ src/core/iomgr/pollset.h \
src/core/iomgr/pollset_set.h \ src/core/iomgr/pollset_set.h \
src/core/iomgr/pollset_set_posix.h \
src/core/iomgr/pollset_set_windows.h \ src/core/iomgr/pollset_set_windows.h \
src/core/iomgr/pollset_windows.h \ src/core/iomgr/pollset_windows.h \
src/core/iomgr/resolve_address.h \ src/core/iomgr/resolve_address.h \

@ -3205,42 +3205,6 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"end2end_certs",
"end2end_tests",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "h2_full+poll_test",
"src": [
"test/core/end2end/fixtures/h2_full+poll.c"
],
"third_party": false,
"type": "target"
},
{
"deps": [
"end2end_certs",
"end2end_tests",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "h2_full+poll+pipe_test",
"src": [
"test/core/end2end/fixtures/h2_full+poll+pipe.c"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [ "deps": [
"end2end_certs", "end2end_certs",
@ -3349,24 +3313,6 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"end2end_certs",
"end2end_tests",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "h2_ssl+poll_test",
"src": [
"test/core/end2end/fixtures/h2_ssl+poll.c"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [ "deps": [
"end2end_certs", "end2end_certs",
@ -3421,24 +3367,6 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"end2end_certs",
"end2end_tests",
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "h2_uds+poll_test",
"src": [
"test/core/end2end/fixtures/h2_uds+poll.c"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [ "deps": [
"end2end_nosec_tests", "end2end_nosec_tests",
@ -3507,40 +3435,6 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"end2end_nosec_tests",
"gpr",
"gpr_test_util",
"grpc_test_util_unsecure",
"grpc_unsecure"
],
"headers": [],
"language": "c",
"name": "h2_full+poll_nosec_test",
"src": [
"test/core/end2end/fixtures/h2_full+poll.c"
],
"third_party": false,
"type": "target"
},
{
"deps": [
"end2end_nosec_tests",
"gpr",
"gpr_test_util",
"grpc_test_util_unsecure",
"grpc_unsecure"
],
"headers": [],
"language": "c",
"name": "h2_full+poll+pipe_nosec_test",
"src": [
"test/core/end2end/fixtures/h2_full+poll+pipe.c"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [ "deps": [
"end2end_nosec_tests", "end2end_nosec_tests",
@ -3643,23 +3537,6 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"end2end_nosec_tests",
"gpr",
"gpr_test_util",
"grpc_test_util_unsecure",
"grpc_unsecure"
],
"headers": [],
"language": "c",
"name": "h2_uds+poll_nosec_test",
"src": [
"test/core/end2end/fixtures/h2_uds+poll.c"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [], "deps": [],
"headers": [ "headers": [
@ -3905,7 +3782,6 @@
"src/core/iomgr/iomgr_posix.h", "src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h", "src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h", "src/core/iomgr/resolve_address.h",
@ -4113,7 +3989,6 @@
"src/core/iomgr/iomgr_windows.c", "src/core/iomgr/iomgr_windows.c",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.c", "src/core/iomgr/pollset_set_windows.c",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.c", "src/core/iomgr/pollset_windows.c",
@ -4459,7 +4334,6 @@
"src/core/iomgr/iomgr_posix.h", "src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h", "src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h", "src/core/iomgr/resolve_address.h",
@ -4651,7 +4525,6 @@
"src/core/iomgr/iomgr_windows.c", "src/core/iomgr/iomgr_windows.c",
"src/core/iomgr/pollset.h", "src/core/iomgr/pollset.h",
"src/core/iomgr/pollset_set.h", "src/core/iomgr/pollset_set.h",
"src/core/iomgr/pollset_set_posix.h",
"src/core/iomgr/pollset_set_windows.c", "src/core/iomgr/pollset_set_windows.c",
"src/core/iomgr/pollset_set_windows.h", "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.c", "src/core/iomgr/pollset_windows.c",

File diff suppressed because it is too large Load Diff

@ -330,7 +330,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr_posix.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_windows.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_windows.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\resolve_address.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\resolve_address.h" />

@ -659,9 +659,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h"> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h"> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
</ClInclude> </ClInclude>

@ -320,7 +320,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr_posix.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_windows.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_windows.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\resolve_address.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\resolve_address.h" />

@ -596,9 +596,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h"> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set.h">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h"> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\pollset_set_windows.h">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
</ClInclude> </ClInclude>

Loading…
Cancel
Save