grpc 1.8.7 → 1.9.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (488) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +549 -325
  3. data/include/grpc/impl/codegen/grpc_types.h +1 -2
  4. data/include/grpc/impl/codegen/port_platform.h +46 -5
  5. data/include/grpc/impl/codegen/slice.h +1 -2
  6. data/include/grpc/module.modulemap +0 -2
  7. data/include/grpc/slice_buffer.h +1 -2
  8. data/include/grpc/support/log.h +4 -2
  9. data/include/grpc/support/thd.h +4 -1
  10. data/include/grpc/support/tls.h +6 -0
  11. data/include/grpc/support/tls_gcc.h +5 -40
  12. data/include/grpc/support/tls_msvc.h +9 -0
  13. data/include/grpc/support/tls_pthread.h +9 -0
  14. data/src/core/ext/filters/client_channel/backup_poller.cc +32 -29
  15. data/src/core/ext/filters/client_channel/backup_poller.h +2 -2
  16. data/src/core/ext/filters/client_channel/channel_connectivity.cc +26 -32
  17. data/src/core/ext/filters/client_channel/client_channel.cc +325 -356
  18. data/src/core/ext/filters/client_channel/client_channel.h +4 -12
  19. data/src/core/ext/filters/client_channel/client_channel_factory.cc +9 -14
  20. data/src/core/ext/filters/client_channel/client_channel_factory.h +7 -20
  21. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +7 -10
  22. data/src/core/ext/filters/client_channel/connector.cc +6 -7
  23. data/src/core/ext/filters/client_channel/connector.h +6 -16
  24. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +38 -50
  25. data/src/core/ext/filters/client_channel/http_connect_handshaker.h +0 -8
  26. data/src/core/ext/filters/client_channel/http_proxy.cc +9 -13
  27. data/src/core/ext/filters/client_channel/http_proxy.h +0 -8
  28. data/src/core/ext/filters/client_channel/lb_policy.cc +72 -94
  29. data/src/core/ext/filters/client_channel/lb_policy.h +83 -92
  30. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +14 -19
  31. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +0 -8
  32. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +474 -591
  33. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -8
  34. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +2 -10
  35. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +6 -6
  36. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +0 -8
  37. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +0 -9
  38. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +0 -9
  39. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +3 -4
  40. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +9 -12
  41. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +160 -182
  42. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +182 -221
  43. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +24 -35
  44. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +9 -20
  45. data/src/core/ext/filters/client_channel/lb_policy_factory.cc +6 -9
  46. data/src/core/ext/filters/client_channel/lb_policy_factory.h +4 -15
  47. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +3 -3
  48. data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -9
  49. data/src/core/ext/filters/client_channel/parse_address.cc +1 -1
  50. data/src/core/ext/filters/client_channel/parse_address.h +0 -8
  51. data/src/core/ext/filters/client_channel/proxy_mapper.cc +6 -8
  52. data/src/core/ext/filters/client_channel/proxy_mapper.h +6 -16
  53. data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +13 -17
  54. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +2 -12
  55. data/src/core/ext/filters/client_channel/resolver.cc +11 -13
  56. data/src/core/ext/filters/client_channel/resolver.h +14 -25
  57. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +57 -70
  58. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +2 -12
  59. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +23 -31
  60. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +27 -45
  61. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +5 -15
  62. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +9 -11
  63. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +53 -66
  64. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +25 -33
  65. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +1 -9
  66. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +26 -35
  67. data/src/core/ext/filters/client_channel/resolver_factory.cc +2 -3
  68. data/src/core/ext/filters/client_channel/resolver_factory.h +2 -12
  69. data/src/core/ext/filters/client_channel/resolver_registry.cc +12 -15
  70. data/src/core/ext/filters/client_channel/resolver_registry.h +3 -12
  71. data/src/core/ext/filters/client_channel/retry_throttle.h +0 -8
  72. data/src/core/ext/filters/client_channel/subchannel.cc +289 -301
  73. data/src/core/ext/filters/client_channel/subchannel.h +57 -84
  74. data/src/core/ext/filters/client_channel/subchannel_index.cc +30 -33
  75. data/src/core/ext/filters/client_channel/subchannel_index.h +4 -16
  76. data/src/core/ext/filters/client_channel/uri_parser.cc +13 -17
  77. data/src/core/ext/filters/client_channel/uri_parser.h +1 -10
  78. data/src/core/ext/filters/deadline/deadline_filter.cc +49 -67
  79. data/src/core/ext/filters/deadline/deadline_filter.h +4 -14
  80. data/src/core/ext/filters/http/client/http_client_filter.cc +60 -77
  81. data/src/core/ext/filters/http/client/http_client_filter.h +0 -8
  82. data/src/core/ext/filters/http/http_filters_plugin.cc +4 -6
  83. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +63 -79
  84. data/src/core/ext/filters/http/message_compress/message_compress_filter.h +0 -8
  85. data/src/core/ext/filters/http/server/http_server_filter.cc +57 -71
  86. data/src/core/ext/filters/http/server/http_server_filter.h +0 -8
  87. data/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +19 -24
  88. data/src/core/ext/filters/load_reporting/server_load_reporting_filter.h +0 -8
  89. data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc +3 -3
  90. data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h +0 -8
  91. data/src/core/ext/filters/max_age/max_age_filter.cc +49 -62
  92. data/src/core/ext/filters/max_age/max_age_filter.h +0 -8
  93. data/src/core/ext/filters/message_size/message_size_filter.cc +23 -29
  94. data/src/core/ext/filters/message_size/message_size_filter.h +0 -8
  95. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +15 -18
  96. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +0 -8
  97. data/src/core/ext/filters/workarounds/workaround_utils.h +0 -8
  98. data/src/core/ext/transport/chttp2/alpn/alpn.h +0 -8
  99. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +33 -40
  100. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +0 -8
  101. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +15 -17
  102. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +8 -8
  103. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +23 -28
  104. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +50 -57
  105. data/src/core/ext/transport/chttp2/server/chttp2_server.h +1 -10
  106. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +3 -3
  107. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +7 -10
  108. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +5 -6
  109. data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +7 -9
  110. data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -11
  111. data/src/core/ext/transport/chttp2/transport/bin_encoder.h +1 -9
  112. data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +10 -2
  113. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +516 -636
  114. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +4 -11
  115. data/src/core/ext/transport/chttp2/transport/flow_control.cc +29 -13
  116. data/src/core/ext/transport/chttp2/transport/flow_control.h +196 -53
  117. data/src/core/ext/transport/chttp2/transport/frame.h +0 -8
  118. data/src/core/ext/transport/chttp2/transport/frame_data.cc +31 -33
  119. data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -12
  120. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -3
  121. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -10
  122. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -6
  123. data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -9
  124. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -3
  125. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -10
  126. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +8 -3
  127. data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -10
  128. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +8 -8
  129. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +5 -11
  130. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +63 -81
  131. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -12
  132. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +230 -318
  133. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +6 -19
  134. data/src/core/ext/transport/chttp2/transport/hpack_table.cc +14 -20
  135. data/src/core/ext/transport/chttp2/transport/hpack_table.h +5 -16
  136. data/src/core/ext/transport/chttp2/transport/http2_settings.h +0 -7
  137. data/src/core/ext/transport/chttp2/transport/huffsyms.h +0 -8
  138. data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +8 -11
  139. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +4 -13
  140. data/src/core/ext/transport/chttp2/transport/internal.h +51 -75
  141. data/src/core/ext/transport/chttp2/transport/parsing.cc +83 -109
  142. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +2 -0
  143. data/src/core/ext/transport/chttp2/transport/stream_map.h +0 -8
  144. data/src/core/ext/transport/chttp2/transport/varint.h +0 -8
  145. data/src/core/ext/transport/chttp2/transport/writing.cc +61 -65
  146. data/src/core/ext/transport/inproc/inproc_plugin.cc +2 -4
  147. data/src/core/ext/transport/inproc/inproc_transport.cc +177 -188
  148. data/src/core/ext/transport/inproc/inproc_transport.h +0 -8
  149. data/src/core/lib/backoff/backoff.cc +39 -44
  150. data/src/core/lib/backoff/backoff.h +61 -57
  151. data/src/core/lib/channel/channel_args.cc +8 -10
  152. data/src/core/lib/channel/channel_args.h +4 -13
  153. data/src/core/lib/channel/channel_stack.cc +19 -27
  154. data/src/core/lib/channel/channel_stack.h +27 -47
  155. data/src/core/lib/channel/channel_stack_builder.cc +11 -14
  156. data/src/core/lib/channel/channel_stack_builder.h +4 -15
  157. data/src/core/lib/channel/connected_channel.cc +23 -36
  158. data/src/core/lib/channel/connected_channel.h +1 -10
  159. data/src/core/lib/channel/handshaker.cc +31 -40
  160. data/src/core/lib/channel/handshaker.h +14 -25
  161. data/src/core/lib/channel/handshaker_factory.cc +6 -6
  162. data/src/core/lib/channel/handshaker_factory.h +5 -15
  163. data/src/core/lib/channel/handshaker_registry.cc +9 -13
  164. data/src/core/lib/channel/handshaker_registry.h +2 -11
  165. data/src/core/lib/compression/algorithm_metadata.h +0 -8
  166. data/src/core/lib/compression/message_compress.cc +19 -23
  167. data/src/core/lib/compression/message_compress.h +2 -12
  168. data/src/core/lib/compression/stream_compression.cc +1 -1
  169. data/src/core/lib/compression/stream_compression.h +0 -8
  170. data/src/core/lib/compression/stream_compression_gzip.cc +12 -11
  171. data/src/core/lib/compression/stream_compression_gzip.h +0 -8
  172. data/src/core/lib/compression/stream_compression_identity.h +0 -8
  173. data/src/core/lib/debug/stats.cc +4 -4
  174. data/src/core/lib/debug/stats.h +9 -19
  175. data/src/core/lib/debug/stats_data.cc +85 -116
  176. data/src/core/lib/debug/stats_data.h +236 -312
  177. data/src/core/lib/debug/trace.cc +1 -1
  178. data/src/core/lib/debug/trace.h +0 -12
  179. data/src/core/lib/{support → gpr++}/abstract.h +8 -3
  180. data/src/core/lib/{support → gpr++}/atomic.h +5 -5
  181. data/src/core/lib/{support → gpr++}/atomic_with_atm.h +3 -3
  182. data/src/core/lib/{support → gpr++}/atomic_with_std.h +3 -3
  183. data/src/core/lib/gpr++/debug_location.h +52 -0
  184. data/src/core/lib/gpr++/inlined_vector.h +112 -0
  185. data/src/core/lib/{support → gpr++}/manual_constructor.h +2 -2
  186. data/src/core/lib/{support → gpr++}/memory.h +3 -3
  187. data/src/core/lib/gpr++/orphanable.h +171 -0
  188. data/src/core/lib/gpr++/ref_counted.h +133 -0
  189. data/src/core/lib/gpr++/ref_counted_ptr.h +99 -0
  190. data/src/core/lib/{support → gpr}/alloc.cc +0 -0
  191. data/src/core/lib/{support → gpr}/arena.cc +1 -1
  192. data/src/core/lib/{support → gpr}/arena.h +3 -11
  193. data/src/core/lib/{support → gpr}/atm.cc +0 -0
  194. data/src/core/lib/{support → gpr}/avl.cc +0 -0
  195. data/src/core/lib/{support → gpr}/cmdline.cc +1 -1
  196. data/src/core/lib/{support → gpr}/cpu_iphone.cc +0 -0
  197. data/src/core/lib/{support → gpr}/cpu_linux.cc +0 -0
  198. data/src/core/lib/{support → gpr}/cpu_posix.cc +0 -0
  199. data/src/core/lib/{support → gpr}/cpu_windows.cc +0 -0
  200. data/src/core/lib/{support → gpr}/env.h +3 -11
  201. data/src/core/lib/{support → gpr}/env_linux.cc +2 -2
  202. data/src/core/lib/{support → gpr}/env_posix.cc +4 -4
  203. data/src/core/lib/{support → gpr}/env_windows.cc +3 -3
  204. data/src/core/lib/{support → gpr}/fork.cc +3 -3
  205. data/src/core/lib/{support → gpr}/fork.h +3 -3
  206. data/src/core/lib/{support → gpr}/host_port.cc +1 -1
  207. data/src/core/lib/{support → gpr}/log.cc +3 -3
  208. data/src/core/lib/{support → gpr}/log_android.cc +3 -3
  209. data/src/core/lib/{support → gpr}/log_linux.cc +1 -1
  210. data/src/core/lib/{support → gpr}/log_posix.cc +5 -5
  211. data/src/core/lib/{support → gpr}/log_windows.cc +3 -3
  212. data/src/core/lib/{support → gpr}/mpscq.cc +1 -1
  213. data/src/core/lib/{support → gpr}/mpscq.h +3 -10
  214. data/src/core/lib/{support → gpr}/murmur_hash.cc +1 -1
  215. data/src/core/lib/{support → gpr}/murmur_hash.h +3 -11
  216. data/src/core/lib/{support → gpr}/spinlock.h +3 -3
  217. data/src/core/lib/{support → gpr}/string.cc +1 -1
  218. data/src/core/lib/{support → gpr}/string.h +3 -10
  219. data/src/core/lib/{support → gpr}/string_posix.cc +0 -0
  220. data/src/core/lib/{support → gpr}/string_util_windows.cc +2 -2
  221. data/src/core/lib/{support → gpr}/string_windows.cc +1 -1
  222. data/src/core/lib/{support → gpr}/string_windows.h +3 -11
  223. data/src/core/lib/{support → gpr}/subprocess_posix.cc +0 -0
  224. data/src/core/lib/{support → gpr}/subprocess_windows.cc +2 -2
  225. data/src/core/lib/{support → gpr}/sync.cc +0 -0
  226. data/src/core/lib/{support → gpr}/sync_posix.cc +10 -1
  227. data/src/core/lib/{support → gpr}/sync_windows.cc +0 -0
  228. data/src/core/lib/{support → gpr}/thd.cc +0 -0
  229. data/src/core/lib/{support → gpr}/thd_internal.h +3 -3
  230. data/src/core/lib/{support → gpr}/thd_posix.cc +18 -2
  231. data/src/core/lib/{support → gpr}/thd_windows.cc +2 -1
  232. data/src/core/lib/{support → gpr}/time.cc +0 -0
  233. data/src/core/lib/{support → gpr}/time_posix.cc +2 -4
  234. data/src/core/lib/{support → gpr}/time_precise.cc +1 -1
  235. data/src/core/lib/{support → gpr}/time_precise.h +3 -11
  236. data/src/core/lib/{support → gpr}/time_windows.cc +1 -3
  237. data/src/core/lib/{support → gpr}/tls_pthread.cc +0 -0
  238. data/src/core/lib/{support → gpr}/tmpfile.h +3 -11
  239. data/src/core/lib/{support → gpr}/tmpfile_msys.cc +2 -2
  240. data/src/core/lib/{support → gpr}/tmpfile_posix.cc +2 -2
  241. data/src/core/lib/{support → gpr}/tmpfile_windows.cc +2 -2
  242. data/src/core/lib/{support → gpr}/wrap_memcpy.cc +0 -0
  243. data/src/core/lib/http/format_request.cc +1 -1
  244. data/src/core/lib/http/format_request.h +0 -8
  245. data/src/core/lib/http/httpcli.cc +55 -74
  246. data/src/core/lib/http/httpcli.h +13 -22
  247. data/src/core/lib/http/httpcli_security_connector.cc +27 -33
  248. data/src/core/lib/http/parser.h +0 -8
  249. data/src/core/lib/iomgr/block_annotate.h +10 -17
  250. data/src/core/lib/iomgr/call_combiner.cc +14 -17
  251. data/src/core/lib/iomgr/call_combiner.h +16 -34
  252. data/src/core/lib/iomgr/closure.h +24 -37
  253. data/src/core/lib/iomgr/combiner.cc +62 -66
  254. data/src/core/lib/iomgr/combiner.h +6 -16
  255. data/src/core/lib/iomgr/endpoint.cc +15 -21
  256. data/src/core/lib/iomgr/endpoint.h +16 -33
  257. data/src/core/lib/iomgr/endpoint_pair.h +0 -8
  258. data/src/core/lib/iomgr/endpoint_pair_posix.cc +4 -5
  259. data/src/core/lib/iomgr/endpoint_pair_windows.cc +4 -6
  260. data/src/core/lib/iomgr/error.cc +2 -6
  261. data/src/core/lib/iomgr/error.h +4 -9
  262. data/src/core/lib/iomgr/error_internal.h +0 -8
  263. data/src/core/lib/iomgr/ev_epoll1_linux.cc +110 -117
  264. data/src/core/lib/iomgr/ev_epoll1_linux.h +0 -8
  265. data/src/core/lib/iomgr/ev_epollex_linux.cc +111 -141
  266. data/src/core/lib/iomgr/ev_epollex_linux.h +0 -8
  267. data/src/core/lib/iomgr/ev_epollsig_linux.cc +83 -109
  268. data/src/core/lib/iomgr/ev_epollsig_linux.h +2 -10
  269. data/src/core/lib/iomgr/ev_poll_posix.cc +103 -125
  270. data/src/core/lib/iomgr/ev_poll_posix.h +0 -8
  271. data/src/core/lib/iomgr/ev_posix.cc +35 -50
  272. data/src/core/lib/iomgr/ev_posix.h +27 -53
  273. data/src/core/lib/iomgr/exec_ctx.cc +46 -78
  274. data/src/core/lib/iomgr/exec_ctx.h +127 -60
  275. data/src/core/lib/iomgr/executor.cc +34 -38
  276. data/src/core/lib/iomgr/executor.h +3 -11
  277. data/src/core/lib/iomgr/fork_posix.cc +13 -12
  278. data/src/core/lib/iomgr/gethostname.h +0 -8
  279. data/src/core/lib/iomgr/gethostname_sysconf.cc +1 -1
  280. data/src/core/lib/iomgr/iocp_windows.cc +14 -16
  281. data/src/core/lib/iomgr/iocp_windows.h +1 -10
  282. data/src/core/lib/iomgr/iomgr.cc +60 -59
  283. data/src/core/lib/iomgr/iomgr.h +3 -12
  284. data/src/core/lib/iomgr/iomgr_internal.h +0 -8
  285. data/src/core/lib/iomgr/iomgr_uv.cc +2 -3
  286. data/src/core/lib/iomgr/iomgr_uv.h +0 -8
  287. data/src/core/lib/iomgr/is_epollexclusive_available.cc +1 -1
  288. data/src/core/lib/iomgr/load_file.cc +1 -1
  289. data/src/core/lib/iomgr/load_file.h +0 -8
  290. data/src/core/lib/iomgr/lockfree_event.cc +7 -8
  291. data/src/core/lib/iomgr/lockfree_event.h +3 -3
  292. data/src/core/lib/iomgr/polling_entity.cc +6 -10
  293. data/src/core/lib/iomgr/polling_entity.h +2 -11
  294. data/src/core/lib/iomgr/pollset.h +4 -13
  295. data/src/core/lib/iomgr/pollset_set.h +5 -18
  296. data/src/core/lib/iomgr/pollset_set_uv.cc +5 -10
  297. data/src/core/lib/iomgr/pollset_set_windows.cc +5 -10
  298. data/src/core/lib/iomgr/pollset_uv.cc +8 -9
  299. data/src/core/lib/iomgr/pollset_uv.h +0 -8
  300. data/src/core/lib/iomgr/pollset_windows.cc +14 -15
  301. data/src/core/lib/iomgr/pollset_windows.h +0 -8
  302. data/src/core/lib/iomgr/port.h +6 -1
  303. data/src/core/lib/iomgr/resolve_address.h +1 -10
  304. data/src/core/lib/iomgr/resolve_address_posix.cc +10 -12
  305. data/src/core/lib/iomgr/resolve_address_uv.cc +7 -8
  306. data/src/core/lib/iomgr/resolve_address_windows.cc +8 -9
  307. data/src/core/lib/iomgr/resource_quota.cc +77 -107
  308. data/src/core/lib/iomgr/resource_quota.h +8 -25
  309. data/src/core/lib/iomgr/sockaddr_utils.cc +1 -1
  310. data/src/core/lib/iomgr/sockaddr_utils.h +0 -8
  311. data/src/core/lib/iomgr/socket_factory_posix.cc +1 -1
  312. data/src/core/lib/iomgr/socket_factory_posix.h +0 -8
  313. data/src/core/lib/iomgr/socket_mutator.cc +1 -1
  314. data/src/core/lib/iomgr/socket_mutator.h +1 -9
  315. data/src/core/lib/iomgr/socket_utils.h +0 -8
  316. data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -1
  317. data/src/core/lib/iomgr/socket_utils_posix.h +0 -8
  318. data/src/core/lib/iomgr/socket_windows.cc +8 -11
  319. data/src/core/lib/iomgr/socket_windows.h +3 -14
  320. data/src/core/lib/iomgr/tcp_client.h +1 -10
  321. data/src/core/lib/iomgr/tcp_client_posix.cc +94 -78
  322. data/src/core/lib/iomgr/tcp_client_posix.h +36 -8
  323. data/src/core/lib/iomgr/tcp_client_uv.cc +16 -23
  324. data/src/core/lib/iomgr/tcp_client_windows.cc +22 -25
  325. data/src/core/lib/iomgr/tcp_posix.cc +131 -153
  326. data/src/core/lib/iomgr/tcp_posix.h +3 -12
  327. data/src/core/lib/iomgr/tcp_server.h +6 -17
  328. data/src/core/lib/iomgr/tcp_server_posix.cc +31 -35
  329. data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -8
  330. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -1
  331. data/src/core/lib/iomgr/tcp_server_uv.cc +23 -34
  332. data/src/core/lib/iomgr/tcp_server_windows.cc +24 -34
  333. data/src/core/lib/iomgr/tcp_uv.cc +42 -56
  334. data/src/core/lib/iomgr/tcp_uv.h +0 -8
  335. data/src/core/lib/iomgr/tcp_windows.cc +43 -50
  336. data/src/core/lib/iomgr/tcp_windows.h +1 -9
  337. data/src/core/lib/iomgr/time_averaged_stats.h +0 -8
  338. data/src/core/lib/iomgr/timer.h +6 -15
  339. data/src/core/lib/iomgr/timer_generic.cc +22 -27
  340. data/src/core/lib/iomgr/timer_heap.h +0 -8
  341. data/src/core/lib/iomgr/timer_manager.cc +17 -19
  342. data/src/core/lib/iomgr/timer_manager.h +0 -8
  343. data/src/core/lib/iomgr/timer_uv.cc +12 -14
  344. data/src/core/lib/iomgr/udp_server.cc +148 -54
  345. data/src/core/lib/iomgr/udp_server.h +16 -21
  346. data/src/core/lib/iomgr/unix_sockets_posix.h +0 -8
  347. data/src/core/lib/iomgr/wakeup_fd_cv.cc +4 -4
  348. data/src/core/lib/iomgr/wakeup_fd_cv.h +12 -20
  349. data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +1 -1
  350. data/src/core/lib/iomgr/wakeup_fd_pipe.h +0 -8
  351. data/src/core/lib/iomgr/wakeup_fd_posix.h +0 -8
  352. data/src/core/lib/json/json.h +0 -8
  353. data/src/core/lib/json/json_reader.h +0 -8
  354. data/src/core/lib/json/json_writer.h +0 -8
  355. data/src/core/lib/profiling/basic_timers.cc +3 -2
  356. data/src/core/lib/profiling/timers.h +0 -8
  357. data/src/core/lib/security/context/security_context.cc +9 -10
  358. data/src/core/lib/security/context/security_context.h +0 -8
  359. data/src/core/lib/security/credentials/composite/composite_credentials.cc +23 -28
  360. data/src/core/lib/security/credentials/composite/composite_credentials.h +0 -8
  361. data/src/core/lib/security/credentials/credentials.cc +33 -42
  362. data/src/core/lib/security/credentials/credentials.h +24 -43
  363. data/src/core/lib/security/credentials/credentials_metadata.cc +2 -2
  364. data/src/core/lib/security/credentials/fake/fake_credentials.cc +16 -22
  365. data/src/core/lib/security/credentials/fake/fake_credentials.h +0 -8
  366. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +3 -3
  367. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +28 -34
  368. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +0 -8
  369. data/src/core/lib/security/credentials/iam/iam_credentials.cc +9 -13
  370. data/src/core/lib/security/credentials/jwt/json_token.cc +1 -1
  371. data/src/core/lib/security/credentials/jwt/json_token.h +0 -8
  372. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +14 -20
  373. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +1 -10
  374. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +56 -72
  375. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +5 -17
  376. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +47 -55
  377. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +3 -12
  378. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +23 -28
  379. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +8 -13
  380. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +0 -8
  381. data/src/core/lib/security/transport/auth_filters.h +0 -8
  382. data/src/core/lib/security/transport/client_auth_filter.cc +45 -54
  383. data/src/core/lib/security/transport/lb_targets_info.cc +2 -2
  384. data/src/core/lib/security/transport/lb_targets_info.h +0 -8
  385. data/src/core/lib/security/transport/secure_endpoint.cc +54 -68
  386. data/src/core/lib/security/transport/secure_endpoint.h +0 -8
  387. data/src/core/lib/security/transport/security_connector.cc +62 -86
  388. data/src/core/lib/security/transport/security_connector.h +22 -39
  389. data/src/core/lib/security/transport/security_handshaker.cc +83 -106
  390. data/src/core/lib/security/transport/security_handshaker.h +1 -10
  391. data/src/core/lib/security/transport/server_auth_filter.cc +31 -38
  392. data/src/core/lib/security/transport/tsi_error.h +0 -8
  393. data/src/core/lib/security/util/json_util.h +0 -8
  394. data/src/core/lib/slice/b64.cc +5 -6
  395. data/src/core/lib/slice/b64.h +3 -12
  396. data/src/core/lib/slice/percent_encoding.h +0 -8
  397. data/src/core/lib/slice/slice.cc +8 -9
  398. data/src/core/lib/slice/slice_buffer.cc +11 -16
  399. data/src/core/lib/slice/slice_hash_table.cc +5 -7
  400. data/src/core/lib/slice/slice_hash_table.h +2 -12
  401. data/src/core/lib/slice/slice_intern.cc +4 -5
  402. data/src/core/lib/slice/slice_internal.h +4 -15
  403. data/src/core/lib/slice/slice_string_helpers.cc +1 -1
  404. data/src/core/lib/slice/slice_string_helpers.h +1 -9
  405. data/src/core/lib/surface/alarm.cc +11 -14
  406. data/src/core/lib/surface/alarm_internal.h +0 -8
  407. data/src/core/lib/surface/byte_buffer.cc +2 -3
  408. data/src/core/lib/surface/byte_buffer_reader.cc +7 -9
  409. data/src/core/lib/surface/call.cc +198 -241
  410. data/src/core/lib/surface/call.h +9 -23
  411. data/src/core/lib/surface/call_details.cc +3 -4
  412. data/src/core/lib/surface/call_log_batch.cc +1 -1
  413. data/src/core/lib/surface/call_test_only.h +0 -8
  414. data/src/core/lib/surface/channel.cc +53 -64
  415. data/src/core/lib/surface/channel.h +12 -23
  416. data/src/core/lib/surface/channel_init.cc +2 -3
  417. data/src/core/lib/surface/channel_init.h +2 -12
  418. data/src/core/lib/surface/channel_ping.cc +7 -9
  419. data/src/core/lib/surface/channel_stack_type.h +0 -8
  420. data/src/core/lib/surface/completion_queue.cc +158 -176
  421. data/src/core/lib/surface/completion_queue.h +9 -20
  422. data/src/core/lib/surface/completion_queue_factory.h +0 -8
  423. data/src/core/lib/surface/event_string.cc +1 -1
  424. data/src/core/lib/surface/event_string.h +0 -8
  425. data/src/core/lib/surface/init.cc +27 -25
  426. data/src/core/lib/surface/init.h +0 -8
  427. data/src/core/lib/surface/init_secure.cc +2 -2
  428. data/src/core/lib/surface/lame_client.cc +30 -33
  429. data/src/core/lib/surface/lame_client.h +0 -8
  430. data/src/core/lib/surface/server.cc +151 -203
  431. data/src/core/lib/surface/server.h +7 -16
  432. data/src/core/lib/surface/validate_metadata.h +0 -8
  433. data/src/core/lib/surface/version.cc +2 -2
  434. data/src/core/lib/transport/bdp_estimator.cc +2 -2
  435. data/src/core/lib/transport/bdp_estimator.h +1 -1
  436. data/src/core/lib/transport/byte_stream.cc +24 -38
  437. data/src/core/lib/transport/byte_stream.h +10 -25
  438. data/src/core/lib/transport/connectivity_state.cc +9 -13
  439. data/src/core/lib/transport/connectivity_state.h +4 -14
  440. data/src/core/lib/transport/error_utils.cc +6 -6
  441. data/src/core/lib/transport/error_utils.h +2 -11
  442. data/src/core/lib/transport/metadata.cc +21 -23
  443. data/src/core/lib/transport/metadata.h +8 -20
  444. data/src/core/lib/transport/metadata_batch.cc +34 -45
  445. data/src/core/lib/transport/metadata_batch.h +18 -32
  446. data/src/core/lib/transport/service_config.cc +11 -15
  447. data/src/core/lib/transport/service_config.h +3 -13
  448. data/src/core/lib/transport/static_metadata.cc +1 -1
  449. data/src/core/lib/transport/static_metadata.h +1 -7
  450. data/src/core/lib/transport/status_conversion.cc +2 -3
  451. data/src/core/lib/transport/status_conversion.h +1 -10
  452. data/src/core/lib/transport/timeout_encoding.cc +1 -1
  453. data/src/core/lib/transport/timeout_encoding.h +1 -9
  454. data/src/core/lib/transport/transport.cc +36 -50
  455. data/src/core/lib/transport/transport.h +28 -30
  456. data/src/core/lib/transport/transport_impl.h +12 -23
  457. data/src/core/lib/transport/transport_op_string.cc +2 -2
  458. data/src/core/plugin_registry/grpc_plugin_registry.cc +34 -34
  459. data/src/core/tsi/fake_transport_security.cc +7 -10
  460. data/src/core/tsi/fake_transport_security.h +0 -8
  461. data/src/core/tsi/gts_transport_security.cc +2 -2
  462. data/src/core/tsi/gts_transport_security.h +0 -8
  463. data/src/core/tsi/ssl_transport_security.cc +3 -0
  464. data/src/core/tsi/ssl_transport_security.h +0 -8
  465. data/src/core/tsi/ssl_types.h +0 -8
  466. data/src/core/tsi/transport_security.h +1 -9
  467. data/src/core/tsi/transport_security_adapter.h +0 -8
  468. data/src/core/tsi/transport_security_grpc.cc +11 -18
  469. data/src/core/tsi/transport_security_grpc.h +9 -21
  470. data/src/core/tsi/transport_security_interface.h +0 -8
  471. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +0 -30
  472. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +2 -48
  473. data/src/ruby/lib/grpc/version.rb +1 -1
  474. data/src/ruby/spec/channel_connection_spec.rb +2 -1
  475. data/src/ruby/spec/client_auth_spec.rb +1 -1
  476. data/src/ruby/spec/client_server_spec.rb +2 -2
  477. data/src/ruby/spec/generic/active_call_spec.rb +1 -1
  478. data/src/ruby/spec/generic/client_stub_spec.rb +4 -4
  479. data/src/ruby/spec/generic/interceptor_registry_spec.rb +1 -1
  480. data/src/ruby/spec/generic/rpc_server_spec.rb +12 -12
  481. data/src/ruby/spec/google_rpc_status_utils_spec.rb +3 -2
  482. data/src/ruby/spec/pb/health/checker_spec.rb +1 -1
  483. data/src/ruby/spec/server_spec.rb +9 -9
  484. data/src/ruby/spec/support/helpers.rb +35 -1
  485. metadata +68 -66
  486. data/include/grpc/impl/codegen/exec_ctx_fwd.h +0 -26
  487. data/include/grpc/support/histogram.h +0 -64
  488. data/src/core/lib/support/histogram.cc +0 -227
@@ -22,20 +22,12 @@
22
22
  #include "src/core/lib/iomgr/ev_posix.h"
23
23
  #include "src/core/lib/iomgr/port.h"
24
24
 
25
- #ifdef __cplusplus
26
- extern "C" {
27
- #endif
28
-
29
25
  const grpc_event_engine_vtable* grpc_init_epollsig_linux(bool explicit_request);
30
26
 
31
- #ifdef GRPC_LINUX_EPOLL
27
+ #ifdef GRPC_LINUX_EPOLL_CREATE1
32
28
  void* grpc_fd_get_polling_island(grpc_fd* fd);
33
29
  void* grpc_pollset_get_polling_island(grpc_pollset* ps);
34
30
  bool grpc_are_polling_islands_equal(void* p, void* q);
35
- #endif /* defined(GRPC_LINUX_EPOLL) */
36
-
37
- #ifdef __cplusplus
38
- }
39
- #endif
31
+ #endif /* defined(GRPC_LINUX_EPOLL_CREATE1) */
40
32
 
41
33
  #endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLSIG_LINUX_H */
@@ -38,12 +38,12 @@
38
38
  #include <grpc/support/useful.h>
39
39
 
40
40
  #include "src/core/lib/debug/stats.h"
41
+ #include "src/core/lib/gpr/murmur_hash.h"
41
42
  #include "src/core/lib/iomgr/block_annotate.h"
42
43
  #include "src/core/lib/iomgr/iomgr_internal.h"
43
44
  #include "src/core/lib/iomgr/wakeup_fd_cv.h"
44
45
  #include "src/core/lib/iomgr/wakeup_fd_posix.h"
45
46
  #include "src/core/lib/profiling/timers.h"
46
- #include "src/core/lib/support/murmur_hash.h"
47
47
 
48
48
  #define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1)
49
49
 
@@ -129,8 +129,7 @@ static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset,
129
129
  MUST NOT be called with a pollset lock taken
130
130
  if got_read or got_write are 1, also does the become_{readable,writable} as
131
131
  appropriate. */
132
- static void fd_end_poll(grpc_exec_ctx* exec_ctx, grpc_fd_watcher* rec,
133
- int got_read, int got_write,
132
+ static void fd_end_poll(grpc_fd_watcher* rec, int got_read, int got_write,
134
133
  grpc_pollset* read_notifier_pollset);
135
134
 
136
135
  /* Return 1 if this fd is orphaned, 0 otherwise */
@@ -187,11 +186,9 @@ struct grpc_pollset {
187
186
  };
188
187
 
189
188
  /* Add an fd to a pollset */
190
- static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
191
- struct grpc_fd* fd);
189
+ static void pollset_add_fd(grpc_pollset* pollset, struct grpc_fd* fd);
192
190
 
193
- static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
194
- grpc_pollset_set* pollset_set, grpc_fd* fd);
191
+ static void pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd);
195
192
 
196
193
  /* Convert a timespec to milliseconds:
197
194
  - very small or negative poll times are clamped to zero to do a
@@ -200,8 +197,7 @@ static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
200
197
  - longer than a millisecond polls are rounded up to the next nearest
201
198
  millisecond to avoid spinning
202
199
  - infinite timeouts are converted to -1 */
203
- static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
204
- grpc_millis deadline);
200
+ static int poll_deadline_to_millis_timeout(grpc_millis deadline);
205
201
 
206
202
  /* Allow kick to wakeup the currently polling worker */
207
203
  #define GRPC_POLLSET_CAN_KICK_SELF 1
@@ -209,7 +205,7 @@ static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
209
205
  #define GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP 2
210
206
  /* As per pollset_kick, with an extended set of flags (defined above)
211
207
  -- mostly for fd_posix's use. */
212
- static grpc_error* pollset_kick_ext(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
208
+ static grpc_error* pollset_kick_ext(grpc_pollset* p,
213
209
  grpc_pollset_worker* specific_worker,
214
210
  uint32_t flags) GRPC_MUST_USE_RESULT;
215
211
 
@@ -247,7 +243,7 @@ struct grpc_pollset_set {
247
243
 
248
244
  typedef struct poll_result {
249
245
  gpr_refcount refcount;
250
- cv_node* watchers;
246
+ grpc_cv_node* watchers;
251
247
  int watchcount;
252
248
  struct pollfd* fds;
253
249
  nfds_t nfds;
@@ -278,7 +274,7 @@ typedef struct poll_hash_table {
278
274
  } poll_hash_table;
279
275
 
280
276
  poll_hash_table poll_cache;
281
- cv_fd_table g_cvfds;
277
+ grpc_cv_fd_table g_cvfds;
282
278
 
283
279
  /*******************************************************************************
284
280
  * fd_posix.c
@@ -355,8 +351,7 @@ static bool fd_is_orphaned(grpc_fd* fd) {
355
351
  }
356
352
 
357
353
  /* Return the read-notifier pollset */
358
- static grpc_pollset* fd_get_read_notifier_pollset(grpc_exec_ctx* exec_ctx,
359
- grpc_fd* fd) {
354
+ static grpc_pollset* fd_get_read_notifier_pollset(grpc_fd* fd) {
360
355
  grpc_pollset* notifier = nullptr;
361
356
 
362
357
  gpr_mu_lock(&fd->mu);
@@ -366,39 +361,36 @@ static grpc_pollset* fd_get_read_notifier_pollset(grpc_exec_ctx* exec_ctx,
366
361
  return notifier;
367
362
  }
368
363
 
369
- static grpc_error* pollset_kick_locked(grpc_exec_ctx* exec_ctx,
370
- grpc_fd_watcher* watcher) {
364
+ static grpc_error* pollset_kick_locked(grpc_fd_watcher* watcher) {
371
365
  gpr_mu_lock(&watcher->pollset->mu);
372
366
  GPR_ASSERT(watcher->worker);
373
- grpc_error* err =
374
- pollset_kick_ext(exec_ctx, watcher->pollset, watcher->worker,
375
- GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP);
367
+ grpc_error* err = pollset_kick_ext(watcher->pollset, watcher->worker,
368
+ GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP);
376
369
  gpr_mu_unlock(&watcher->pollset->mu);
377
370
  return err;
378
371
  }
379
372
 
380
- static void maybe_wake_one_watcher_locked(grpc_exec_ctx* exec_ctx,
381
- grpc_fd* fd) {
373
+ static void maybe_wake_one_watcher_locked(grpc_fd* fd) {
382
374
  if (fd->inactive_watcher_root.next != &fd->inactive_watcher_root) {
383
- pollset_kick_locked(exec_ctx, fd->inactive_watcher_root.next);
375
+ pollset_kick_locked(fd->inactive_watcher_root.next);
384
376
  } else if (fd->read_watcher) {
385
- pollset_kick_locked(exec_ctx, fd->read_watcher);
377
+ pollset_kick_locked(fd->read_watcher);
386
378
  } else if (fd->write_watcher) {
387
- pollset_kick_locked(exec_ctx, fd->write_watcher);
379
+ pollset_kick_locked(fd->write_watcher);
388
380
  }
389
381
  }
390
382
 
391
- static void wake_all_watchers_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd) {
383
+ static void wake_all_watchers_locked(grpc_fd* fd) {
392
384
  grpc_fd_watcher* watcher;
393
385
  for (watcher = fd->inactive_watcher_root.next;
394
386
  watcher != &fd->inactive_watcher_root; watcher = watcher->next) {
395
- pollset_kick_locked(exec_ctx, watcher);
387
+ pollset_kick_locked(watcher);
396
388
  }
397
389
  if (fd->read_watcher) {
398
- pollset_kick_locked(exec_ctx, fd->read_watcher);
390
+ pollset_kick_locked(fd->read_watcher);
399
391
  }
400
392
  if (fd->write_watcher && fd->write_watcher != fd->read_watcher) {
401
- pollset_kick_locked(exec_ctx, fd->write_watcher);
393
+ pollset_kick_locked(fd->write_watcher);
402
394
  }
403
395
  }
404
396
 
@@ -407,12 +399,12 @@ static int has_watchers(grpc_fd* fd) {
407
399
  fd->inactive_watcher_root.next != &fd->inactive_watcher_root;
408
400
  }
409
401
 
410
- static void close_fd_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd) {
402
+ static void close_fd_locked(grpc_fd* fd) {
411
403
  fd->closed = 1;
412
404
  if (!fd->released) {
413
405
  close(fd->fd);
414
406
  }
415
- GRPC_CLOSURE_SCHED(exec_ctx, fd->on_done_closure, GRPC_ERROR_NONE);
407
+ GRPC_CLOSURE_SCHED(fd->on_done_closure, GRPC_ERROR_NONE);
416
408
  }
417
409
 
418
410
  static int fd_wrapped_fd(grpc_fd* fd) {
@@ -423,8 +415,7 @@ static int fd_wrapped_fd(grpc_fd* fd) {
423
415
  }
424
416
  }
425
417
 
426
- static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
427
- grpc_closure* on_done, int* release_fd,
418
+ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
428
419
  bool already_closed, const char* reason) {
429
420
  fd->on_done_closure = on_done;
430
421
  fd->released = release_fd != nullptr;
@@ -437,9 +428,9 @@ static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
437
428
  gpr_mu_lock(&fd->mu);
438
429
  REF_BY(fd, 1, reason); /* remove active status, but keep referenced */
439
430
  if (!has_watchers(fd)) {
440
- close_fd_locked(exec_ctx, fd);
431
+ close_fd_locked(fd);
441
432
  } else {
442
- wake_all_watchers_locked(exec_ctx, fd);
433
+ wake_all_watchers_locked(fd);
443
434
  }
444
435
  gpr_mu_unlock(&fd->mu);
445
436
  UNREF_BY(fd, 2, reason); /* drop the reference */
@@ -471,10 +462,10 @@ static grpc_error* fd_shutdown_error(grpc_fd* fd) {
471
462
  }
472
463
  }
473
464
 
474
- static void notify_on_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
475
- grpc_closure** st, grpc_closure* closure) {
465
+ static void notify_on_locked(grpc_fd* fd, grpc_closure** st,
466
+ grpc_closure* closure) {
476
467
  if (fd->shutdown || gpr_atm_no_barrier_load(&fd->pollhup)) {
477
- GRPC_CLOSURE_SCHED(exec_ctx, closure,
468
+ GRPC_CLOSURE_SCHED(closure,
478
469
  GRPC_ERROR_CREATE_FROM_STATIC_STRING("FD shutdown"));
479
470
  } else if (*st == CLOSURE_NOT_READY) {
480
471
  /* not ready ==> switch to a waiting state by setting the closure */
@@ -482,8 +473,8 @@ static void notify_on_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
482
473
  } else if (*st == CLOSURE_READY) {
483
474
  /* already ready ==> queue the closure to run immediately */
484
475
  *st = CLOSURE_NOT_READY;
485
- GRPC_CLOSURE_SCHED(exec_ctx, closure, fd_shutdown_error(fd));
486
- maybe_wake_one_watcher_locked(exec_ctx, fd);
476
+ GRPC_CLOSURE_SCHED(closure, fd_shutdown_error(fd));
477
+ maybe_wake_one_watcher_locked(fd);
487
478
  } else {
488
479
  /* upcallptr was set to a different closure. This is an error! */
489
480
  gpr_log(GPR_ERROR,
@@ -494,8 +485,7 @@ static void notify_on_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
494
485
  }
495
486
 
496
487
  /* returns 1 if state becomes not ready */
497
- static int set_ready_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
498
- grpc_closure** st) {
488
+ static int set_ready_locked(grpc_fd* fd, grpc_closure** st) {
499
489
  if (*st == CLOSURE_READY) {
500
490
  /* duplicate ready ==> ignore */
501
491
  return 0;
@@ -505,18 +495,18 @@ static int set_ready_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
505
495
  return 0;
506
496
  } else {
507
497
  /* waiting ==> queue closure */
508
- GRPC_CLOSURE_SCHED(exec_ctx, *st, fd_shutdown_error(fd));
498
+ GRPC_CLOSURE_SCHED(*st, fd_shutdown_error(fd));
509
499
  *st = CLOSURE_NOT_READY;
510
500
  return 1;
511
501
  }
512
502
  }
513
503
 
514
504
  static void set_read_notifier_pollset_locked(
515
- grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_pollset* read_notifier_pollset) {
505
+ grpc_fd* fd, grpc_pollset* read_notifier_pollset) {
516
506
  fd->read_notifier_pollset = read_notifier_pollset;
517
507
  }
518
508
 
519
- static void fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why) {
509
+ static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
520
510
  gpr_mu_lock(&fd->mu);
521
511
  /* only shutdown once */
522
512
  if (!fd->shutdown) {
@@ -524,8 +514,8 @@ static void fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why) {
524
514
  fd->shutdown_error = why;
525
515
  /* signal read/write closed to OS so that future operations fail */
526
516
  shutdown(fd->fd, SHUT_RDWR);
527
- set_ready_locked(exec_ctx, fd, &fd->read_closure);
528
- set_ready_locked(exec_ctx, fd, &fd->write_closure);
517
+ set_ready_locked(fd, &fd->read_closure);
518
+ set_ready_locked(fd, &fd->write_closure);
529
519
  } else {
530
520
  GRPC_ERROR_UNREF(why);
531
521
  }
@@ -539,17 +529,15 @@ static bool fd_is_shutdown(grpc_fd* fd) {
539
529
  return r;
540
530
  }
541
531
 
542
- static void fd_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
543
- grpc_closure* closure) {
532
+ static void fd_notify_on_read(grpc_fd* fd, grpc_closure* closure) {
544
533
  gpr_mu_lock(&fd->mu);
545
- notify_on_locked(exec_ctx, fd, &fd->read_closure, closure);
534
+ notify_on_locked(fd, &fd->read_closure, closure);
546
535
  gpr_mu_unlock(&fd->mu);
547
536
  }
548
537
 
549
- static void fd_notify_on_write(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
550
- grpc_closure* closure) {
538
+ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
551
539
  gpr_mu_lock(&fd->mu);
552
- notify_on_locked(exec_ctx, fd, &fd->write_closure, closure);
540
+ notify_on_locked(fd, &fd->write_closure, closure);
553
541
  gpr_mu_unlock(&fd->mu);
554
542
  }
555
543
 
@@ -604,8 +592,7 @@ static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset,
604
592
  return mask;
605
593
  }
606
594
 
607
- static void fd_end_poll(grpc_exec_ctx* exec_ctx, grpc_fd_watcher* watcher,
608
- int got_read, int got_write,
595
+ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write,
609
596
  grpc_pollset* read_notifier_pollset) {
610
597
  int was_polling = 0;
611
598
  int kick = 0;
@@ -639,23 +626,23 @@ static void fd_end_poll(grpc_exec_ctx* exec_ctx, grpc_fd_watcher* watcher,
639
626
  watcher->prev->next = watcher->next;
640
627
  }
641
628
  if (got_read) {
642
- if (set_ready_locked(exec_ctx, fd, &fd->read_closure)) {
629
+ if (set_ready_locked(fd, &fd->read_closure)) {
643
630
  kick = 1;
644
631
  }
645
632
  if (read_notifier_pollset != nullptr) {
646
- set_read_notifier_pollset_locked(exec_ctx, fd, read_notifier_pollset);
633
+ set_read_notifier_pollset_locked(fd, read_notifier_pollset);
647
634
  }
648
635
  }
649
636
  if (got_write) {
650
- if (set_ready_locked(exec_ctx, fd, &fd->write_closure)) {
637
+ if (set_ready_locked(fd, &fd->write_closure)) {
651
638
  kick = 1;
652
639
  }
653
640
  }
654
641
  if (kick) {
655
- maybe_wake_one_watcher_locked(exec_ctx, fd);
642
+ maybe_wake_one_watcher_locked(fd);
656
643
  }
657
644
  if (fd_is_orphaned(fd) && !has_watchers(fd) && !fd->closed) {
658
- close_fd_locked(exec_ctx, fd);
645
+ close_fd_locked(fd);
659
646
  }
660
647
  gpr_mu_unlock(&fd->mu);
661
648
 
@@ -716,12 +703,12 @@ static void kick_append_error(grpc_error** composite, grpc_error* error) {
716
703
  *composite = grpc_error_add_child(*composite, error);
717
704
  }
718
705
 
719
- static grpc_error* pollset_kick_ext(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
706
+ static grpc_error* pollset_kick_ext(grpc_pollset* p,
720
707
  grpc_pollset_worker* specific_worker,
721
708
  uint32_t flags) {
722
709
  GPR_TIMER_BEGIN("pollset_kick_ext", 0);
723
710
  grpc_error* error = GRPC_ERROR_NONE;
724
- GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
711
+ GRPC_STATS_INC_POLLSET_KICK();
725
712
 
726
713
  /* pollset->mu already held */
727
714
  if (specific_worker != nullptr) {
@@ -787,9 +774,9 @@ static grpc_error* pollset_kick_ext(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
787
774
  return error;
788
775
  }
789
776
 
790
- static grpc_error* pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
777
+ static grpc_error* pollset_kick(grpc_pollset* p,
791
778
  grpc_pollset_worker* specific_worker) {
792
- return pollset_kick_ext(exec_ctx, p, specific_worker, 0);
779
+ return pollset_kick_ext(p, specific_worker, 0);
793
780
  }
794
781
 
795
782
  /* global state management */
@@ -823,7 +810,7 @@ static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
823
810
  pollset->pollset_set_count = 0;
824
811
  }
825
812
 
826
- static void pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
813
+ static void pollset_destroy(grpc_pollset* pollset) {
827
814
  GPR_ASSERT(!pollset_has_workers(pollset));
828
815
  GPR_ASSERT(pollset->idle_jobs.head == pollset->idle_jobs.tail);
829
816
  while (pollset->local_wakeup_cache) {
@@ -836,8 +823,7 @@ static void pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
836
823
  gpr_mu_destroy(&pollset->mu);
837
824
  }
838
825
 
839
- static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
840
- grpc_fd* fd) {
826
+ static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) {
841
827
  gpr_mu_lock(&pollset->mu);
842
828
  size_t i;
843
829
  /* TODO(ctiller): this is O(num_fds^2); maybe switch to a hash set here */
@@ -852,19 +838,19 @@ static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
852
838
  }
853
839
  pollset->fds[pollset->fd_count++] = fd;
854
840
  GRPC_FD_REF(fd, "multipoller");
855
- pollset_kick(exec_ctx, pollset, nullptr);
841
+ pollset_kick(pollset, nullptr);
856
842
  exit:
857
843
  gpr_mu_unlock(&pollset->mu);
858
844
  }
859
845
 
860
- static void finish_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
846
+ static void finish_shutdown(grpc_pollset* pollset) {
861
847
  GPR_ASSERT(grpc_closure_list_empty(pollset->idle_jobs));
862
848
  size_t i;
863
849
  for (i = 0; i < pollset->fd_count; i++) {
864
850
  GRPC_FD_UNREF(pollset->fds[i], "multipoller");
865
851
  }
866
852
  pollset->fd_count = 0;
867
- GRPC_CLOSURE_SCHED(exec_ctx, pollset->shutdown_done, GRPC_ERROR_NONE);
853
+ GRPC_CLOSURE_SCHED(pollset->shutdown_done, GRPC_ERROR_NONE);
868
854
  }
869
855
 
870
856
  static void work_combine_error(grpc_error** composite, grpc_error* error) {
@@ -875,7 +861,7 @@ static void work_combine_error(grpc_error** composite, grpc_error* error) {
875
861
  *composite = grpc_error_add_child(*composite, error);
876
862
  }
877
863
 
878
- static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
864
+ static grpc_error* pollset_work(grpc_pollset* pollset,
879
865
  grpc_pollset_worker** worker_hdl,
880
866
  grpc_millis deadline) {
881
867
  grpc_pollset_worker worker;
@@ -914,7 +900,7 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
914
900
  if (!pollset_has_workers(pollset) &&
915
901
  !grpc_closure_list_empty(pollset->idle_jobs)) {
916
902
  GPR_TIMER_MARK("pollset_work.idle_jobs", 0);
917
- GRPC_CLOSURE_LIST_SCHED(exec_ctx, &pollset->idle_jobs);
903
+ GRPC_CLOSURE_LIST_SCHED(&pollset->idle_jobs);
918
904
  goto done;
919
905
  }
920
906
  /* If we're shutting down then we don't execute any extended work */
@@ -946,7 +932,7 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
946
932
  grpc_fd_watcher* watchers;
947
933
  struct pollfd* pfds;
948
934
 
949
- timeout = poll_deadline_to_millis_timeout(exec_ctx, deadline);
935
+ timeout = poll_deadline_to_millis_timeout(deadline);
950
936
 
951
937
  if (pollset->fd_count + 2 <= inline_elements) {
952
938
  pfds = pollfd_space;
@@ -991,9 +977,9 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
991
977
  /* TODO(vpai): Consider first doing a 0 timeout poll here to avoid
992
978
  even going into the blocking annotation if possible */
993
979
  GRPC_SCHEDULING_START_BLOCKING_REGION;
994
- GRPC_STATS_INC_SYSCALL_POLL(exec_ctx);
980
+ GRPC_STATS_INC_SYSCALL_POLL();
995
981
  r = grpc_poll_function(pfds, pfd_count, timeout);
996
- GRPC_SCHEDULING_END_BLOCKING_REGION_WITH_EXEC_CTX(exec_ctx);
982
+ GRPC_SCHEDULING_END_BLOCKING_REGION;
997
983
 
998
984
  if (grpc_polling_trace.enabled()) {
999
985
  gpr_log(GPR_DEBUG, "%p poll=%d", pollset, r);
@@ -1006,16 +992,16 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
1006
992
 
1007
993
  for (i = 1; i < pfd_count; i++) {
1008
994
  if (watchers[i].fd == nullptr) {
1009
- fd_end_poll(exec_ctx, &watchers[i], 0, 0, nullptr);
995
+ fd_end_poll(&watchers[i], 0, 0, nullptr);
1010
996
  } else {
1011
997
  // Wake up all the file descriptors, if we have an invalid one
1012
998
  // we can identify it on the next pollset_work()
1013
- fd_end_poll(exec_ctx, &watchers[i], 1, 1, pollset);
999
+ fd_end_poll(&watchers[i], 1, 1, pollset);
1014
1000
  }
1015
1001
  }
1016
1002
  } else if (r == 0) {
1017
1003
  for (i = 1; i < pfd_count; i++) {
1018
- fd_end_poll(exec_ctx, &watchers[i], 0, 0, nullptr);
1004
+ fd_end_poll(&watchers[i], 0, 0, nullptr);
1019
1005
  }
1020
1006
  } else {
1021
1007
  if (pfds[0].revents & POLLIN_CHECK) {
@@ -1027,7 +1013,7 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
1027
1013
  }
1028
1014
  for (i = 1; i < pfd_count; i++) {
1029
1015
  if (watchers[i].fd == nullptr) {
1030
- fd_end_poll(exec_ctx, &watchers[i], 0, 0, nullptr);
1016
+ fd_end_poll(&watchers[i], 0, 0, nullptr);
1031
1017
  } else {
1032
1018
  if (grpc_polling_trace.enabled()) {
1033
1019
  gpr_log(GPR_DEBUG, "%p got_event: %d r:%d w:%d [%d]", pollset,
@@ -1040,7 +1026,7 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
1040
1026
  if (pfds[i].revents & POLLHUP) {
1041
1027
  gpr_atm_no_barrier_store(&watchers[i].fd->pollhup, 1);
1042
1028
  }
1043
- fd_end_poll(exec_ctx, &watchers[i], pfds[i].revents & POLLIN_CHECK,
1029
+ fd_end_poll(&watchers[i], pfds[i].revents & POLLIN_CHECK,
1044
1030
  pfds[i].revents & POLLOUT_CHECK, pollset);
1045
1031
  }
1046
1032
  }
@@ -1063,7 +1049,7 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
1063
1049
  worker list, which means nobody could ask us to re-evaluate polling). */
1064
1050
  done:
1065
1051
  if (!locked) {
1066
- queued_work |= grpc_exec_ctx_flush(exec_ctx);
1052
+ queued_work |= grpc_core::ExecCtx::Get()->Flush();
1067
1053
  gpr_mu_lock(&pollset->mu);
1068
1054
  locked = 1;
1069
1055
  }
@@ -1092,21 +1078,21 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
1092
1078
  /* check shutdown conditions */
1093
1079
  if (pollset->shutting_down) {
1094
1080
  if (pollset_has_workers(pollset)) {
1095
- pollset_kick(exec_ctx, pollset, nullptr);
1081
+ pollset_kick(pollset, nullptr);
1096
1082
  } else if (!pollset->called_shutdown && !pollset_has_observers(pollset)) {
1097
1083
  pollset->called_shutdown = 1;
1098
1084
  gpr_mu_unlock(&pollset->mu);
1099
- finish_shutdown(exec_ctx, pollset);
1100
- grpc_exec_ctx_flush(exec_ctx);
1085
+ finish_shutdown(pollset);
1086
+ grpc_core::ExecCtx::Get()->Flush();
1101
1087
  /* Continuing to access pollset here is safe -- it is the caller's
1102
1088
  * responsibility to not destroy when it has outstanding calls to
1103
1089
  * pollset_work.
1104
1090
  * TODO(dklempner): Can we refactor the shutdown logic to avoid this? */
1105
1091
  gpr_mu_lock(&pollset->mu);
1106
1092
  } else if (!grpc_closure_list_empty(pollset->idle_jobs)) {
1107
- GRPC_CLOSURE_LIST_SCHED(exec_ctx, &pollset->idle_jobs);
1093
+ GRPC_CLOSURE_LIST_SCHED(&pollset->idle_jobs);
1108
1094
  gpr_mu_unlock(&pollset->mu);
1109
- grpc_exec_ctx_flush(exec_ctx);
1095
+ grpc_core::ExecCtx::Get()->Flush();
1110
1096
  gpr_mu_lock(&pollset->mu);
1111
1097
  }
1112
1098
  }
@@ -1116,26 +1102,24 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
1116
1102
  return error;
1117
1103
  }
1118
1104
 
1119
- static void pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
1120
- grpc_closure* closure) {
1105
+ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
1121
1106
  GPR_ASSERT(!pollset->shutting_down);
1122
1107
  pollset->shutting_down = 1;
1123
1108
  pollset->shutdown_done = closure;
1124
- pollset_kick(exec_ctx, pollset, GRPC_POLLSET_KICK_BROADCAST);
1109
+ pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
1125
1110
  if (!pollset_has_workers(pollset)) {
1126
- GRPC_CLOSURE_LIST_SCHED(exec_ctx, &pollset->idle_jobs);
1111
+ GRPC_CLOSURE_LIST_SCHED(&pollset->idle_jobs);
1127
1112
  }
1128
1113
  if (!pollset->called_shutdown && !pollset_has_observers(pollset)) {
1129
1114
  pollset->called_shutdown = 1;
1130
- finish_shutdown(exec_ctx, pollset);
1115
+ finish_shutdown(pollset);
1131
1116
  }
1132
1117
  }
1133
1118
 
1134
- static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
1135
- grpc_millis deadline) {
1119
+ static int poll_deadline_to_millis_timeout(grpc_millis deadline) {
1136
1120
  if (deadline == GRPC_MILLIS_INF_FUTURE) return -1;
1137
1121
  if (deadline == 0) return 0;
1138
- grpc_millis n = deadline - grpc_exec_ctx_now(exec_ctx);
1122
+ grpc_millis n = deadline - grpc_core::ExecCtx::Get()->Now();
1139
1123
  if (n < 0) return 0;
1140
1124
  if (n > INT_MAX) return -1;
1141
1125
  return (int)n;
@@ -1152,8 +1136,7 @@ static grpc_pollset_set* pollset_set_create(void) {
1152
1136
  return pollset_set;
1153
1137
  }
1154
1138
 
1155
- static void pollset_set_destroy(grpc_exec_ctx* exec_ctx,
1156
- grpc_pollset_set* pollset_set) {
1139
+ static void pollset_set_destroy(grpc_pollset_set* pollset_set) {
1157
1140
  size_t i;
1158
1141
  gpr_mu_destroy(&pollset_set->mu);
1159
1142
  for (i = 0; i < pollset_set->fd_count; i++) {
@@ -1168,7 +1151,7 @@ static void pollset_set_destroy(grpc_exec_ctx* exec_ctx,
1168
1151
  !pollset_has_observers(pollset)) {
1169
1152
  pollset->called_shutdown = 1;
1170
1153
  gpr_mu_unlock(&pollset->mu);
1171
- finish_shutdown(exec_ctx, pollset);
1154
+ finish_shutdown(pollset);
1172
1155
  } else {
1173
1156
  gpr_mu_unlock(&pollset->mu);
1174
1157
  }
@@ -1179,8 +1162,7 @@ static void pollset_set_destroy(grpc_exec_ctx* exec_ctx,
1179
1162
  gpr_free(pollset_set);
1180
1163
  }
1181
1164
 
1182
- static void pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
1183
- grpc_pollset_set* pollset_set,
1165
+ static void pollset_set_add_pollset(grpc_pollset_set* pollset_set,
1184
1166
  grpc_pollset* pollset) {
1185
1167
  size_t i, j;
1186
1168
  gpr_mu_lock(&pollset->mu);
@@ -1199,7 +1181,7 @@ static void pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
1199
1181
  if (fd_is_orphaned(pollset_set->fds[i])) {
1200
1182
  GRPC_FD_UNREF(pollset_set->fds[i], "pollset_set");
1201
1183
  } else {
1202
- pollset_add_fd(exec_ctx, pollset, pollset_set->fds[i]);
1184
+ pollset_add_fd(pollset, pollset_set->fds[i]);
1203
1185
  pollset_set->fds[j++] = pollset_set->fds[i];
1204
1186
  }
1205
1187
  }
@@ -1207,8 +1189,7 @@ static void pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
1207
1189
  gpr_mu_unlock(&pollset_set->mu);
1208
1190
  }
1209
1191
 
1210
- static void pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
1211
- grpc_pollset_set* pollset_set,
1192
+ static void pollset_set_del_pollset(grpc_pollset_set* pollset_set,
1212
1193
  grpc_pollset* pollset) {
1213
1194
  size_t i;
1214
1195
  gpr_mu_lock(&pollset_set->mu);
@@ -1228,14 +1209,13 @@ static void pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
1228
1209
  !pollset_has_observers(pollset)) {
1229
1210
  pollset->called_shutdown = 1;
1230
1211
  gpr_mu_unlock(&pollset->mu);
1231
- finish_shutdown(exec_ctx, pollset);
1212
+ finish_shutdown(pollset);
1232
1213
  } else {
1233
1214
  gpr_mu_unlock(&pollset->mu);
1234
1215
  }
1235
1216
  }
1236
1217
 
1237
- static void pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
1238
- grpc_pollset_set* bag,
1218
+ static void pollset_set_add_pollset_set(grpc_pollset_set* bag,
1239
1219
  grpc_pollset_set* item) {
1240
1220
  size_t i, j;
1241
1221
  gpr_mu_lock(&bag->mu);
@@ -1250,7 +1230,7 @@ static void pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
1250
1230
  if (fd_is_orphaned(bag->fds[i])) {
1251
1231
  GRPC_FD_UNREF(bag->fds[i], "pollset_set");
1252
1232
  } else {
1253
- pollset_set_add_fd(exec_ctx, item, bag->fds[i]);
1233
+ pollset_set_add_fd(item, bag->fds[i]);
1254
1234
  bag->fds[j++] = bag->fds[i];
1255
1235
  }
1256
1236
  }
@@ -1258,8 +1238,7 @@ static void pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
1258
1238
  gpr_mu_unlock(&bag->mu);
1259
1239
  }
1260
1240
 
1261
- static void pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
1262
- grpc_pollset_set* bag,
1241
+ static void pollset_set_del_pollset_set(grpc_pollset_set* bag,
1263
1242
  grpc_pollset_set* item) {
1264
1243
  size_t i;
1265
1244
  gpr_mu_lock(&bag->mu);
@@ -1274,8 +1253,7 @@ static void pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
1274
1253
  gpr_mu_unlock(&bag->mu);
1275
1254
  }
1276
1255
 
1277
- static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
1278
- grpc_pollset_set* pollset_set, grpc_fd* fd) {
1256
+ static void pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
1279
1257
  size_t i;
1280
1258
  gpr_mu_lock(&pollset_set->mu);
1281
1259
  if (pollset_set->fd_count == pollset_set->fd_capacity) {
@@ -1286,16 +1264,15 @@ static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
1286
1264
  GRPC_FD_REF(fd, "pollset_set");
1287
1265
  pollset_set->fds[pollset_set->fd_count++] = fd;
1288
1266
  for (i = 0; i < pollset_set->pollset_count; i++) {
1289
- pollset_add_fd(exec_ctx, pollset_set->pollsets[i], fd);
1267
+ pollset_add_fd(pollset_set->pollsets[i], fd);
1290
1268
  }
1291
1269
  for (i = 0; i < pollset_set->pollset_set_count; i++) {
1292
- pollset_set_add_fd(exec_ctx, pollset_set->pollset_sets[i], fd);
1270
+ pollset_set_add_fd(pollset_set->pollset_sets[i], fd);
1293
1271
  }
1294
1272
  gpr_mu_unlock(&pollset_set->mu);
1295
1273
  }
1296
1274
 
1297
- static void pollset_set_del_fd(grpc_exec_ctx* exec_ctx,
1298
- grpc_pollset_set* pollset_set, grpc_fd* fd) {
1275
+ static void pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
1299
1276
  size_t i;
1300
1277
  gpr_mu_lock(&pollset_set->mu);
1301
1278
  for (i = 0; i < pollset_set->fd_count; i++) {
@@ -1308,7 +1285,7 @@ static void pollset_set_del_fd(grpc_exec_ctx* exec_ctx,
1308
1285
  }
1309
1286
  }
1310
1287
  for (i = 0; i < pollset_set->pollset_set_count; i++) {
1311
- pollset_set_del_fd(exec_ctx, pollset_set->pollset_sets[i], fd);
1288
+ pollset_set_del_fd(pollset_set->pollset_sets[i], fd);
1312
1289
  }
1313
1290
  gpr_mu_unlock(&pollset_set->mu);
1314
1291
  }
@@ -1391,7 +1368,7 @@ static poll_args* get_poller_locked(struct pollfd* fds, nfds_t count) {
1391
1368
  gpr_thd_options opt = gpr_thd_options_default();
1392
1369
  gpr_ref(&g_cvfds.pollcount);
1393
1370
  gpr_thd_options_set_detached(&opt);
1394
- GPR_ASSERT(gpr_thd_new(&t_id, &run_poll, pargs, &opt));
1371
+ GPR_ASSERT(gpr_thd_new(&t_id, "grpc_poller", &run_poll, pargs, &opt));
1395
1372
  return pargs;
1396
1373
  }
1397
1374
 
@@ -1467,7 +1444,7 @@ static void decref_poll_result(poll_result* res) {
1467
1444
  }
1468
1445
  }
1469
1446
 
1470
- void remove_cvn(cv_node** head, cv_node* target) {
1447
+ void remove_cvn(grpc_cv_node** head, grpc_cv_node* target) {
1471
1448
  if (target->next) {
1472
1449
  target->next->prev = target->prev;
1473
1450
  }
@@ -1492,7 +1469,7 @@ static void run_poll(void* args) {
1492
1469
  result->completed = 1;
1493
1470
  result->retval = retval;
1494
1471
  result->err = errno;
1495
- cv_node* watcher = result->watchers;
1472
+ grpc_cv_node* watcher = result->watchers;
1496
1473
  while (watcher) {
1497
1474
  gpr_cv_signal(watcher->cv);
1498
1475
  watcher = watcher->next;
@@ -1503,7 +1480,7 @@ static void run_poll(void* args) {
1503
1480
  decref_poll_result(result);
1504
1481
  // Leave this polling thread alive for a grace period to do another poll()
1505
1482
  // op
1506
- gpr_timespec deadline = gpr_now(GPR_CLOCK_REALTIME);
1483
+ gpr_timespec deadline = gpr_now(GPR_CLOCK_MONOTONIC);
1507
1484
  deadline = gpr_time_add(deadline, thread_grace);
1508
1485
  pargs->trigger_set = 0;
1509
1486
  gpr_cv_wait(&pargs->trigger, &g_cvfds.mu, deadline);
@@ -1526,17 +1503,17 @@ static void run_poll(void* args) {
1526
1503
  static int cvfd_poll(struct pollfd* fds, nfds_t nfds, int timeout) {
1527
1504
  unsigned int i;
1528
1505
  int res, idx;
1529
- cv_node* pollcv;
1506
+ grpc_cv_node* pollcv;
1530
1507
  int skip_poll = 0;
1531
1508
  nfds_t nsockfds = 0;
1532
1509
  poll_result* result = nullptr;
1533
1510
  gpr_mu_lock(&g_cvfds.mu);
1534
- pollcv = (cv_node*)gpr_malloc(sizeof(cv_node));
1511
+ pollcv = (grpc_cv_node*)gpr_malloc(sizeof(grpc_cv_node));
1535
1512
  pollcv->next = nullptr;
1536
1513
  gpr_cv pollcv_cv;
1537
1514
  gpr_cv_init(&pollcv_cv);
1538
1515
  pollcv->cv = &pollcv_cv;
1539
- cv_node* fd_cvs = (cv_node*)gpr_malloc(nfds * sizeof(cv_node));
1516
+ grpc_cv_node* fd_cvs = (grpc_cv_node*)gpr_malloc(nfds * sizeof(grpc_cv_node));
1540
1517
 
1541
1518
  for (i = 0; i < nfds; i++) {
1542
1519
  fds[i].revents = 0;
@@ -1558,9 +1535,9 @@ static int cvfd_poll(struct pollfd* fds, nfds_t nfds, int timeout) {
1558
1535
  }
1559
1536
  }
1560
1537
 
1561
- gpr_timespec deadline = gpr_now(GPR_CLOCK_REALTIME);
1538
+ gpr_timespec deadline = gpr_now(GPR_CLOCK_MONOTONIC);
1562
1539
  if (timeout < 0) {
1563
- deadline = gpr_inf_future(GPR_CLOCK_REALTIME);
1540
+ deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
1564
1541
  } else {
1565
1542
  deadline =
1566
1543
  gpr_time_add(deadline, gpr_time_from_millis(timeout, GPR_TIMESPAN));
@@ -1632,7 +1609,8 @@ static void global_cv_fd_table_init() {
1632
1609
  gpr_cv_init(&g_cvfds.shutdown_cv);
1633
1610
  gpr_ref_init(&g_cvfds.pollcount, 1);
1634
1611
  g_cvfds.size = CV_DEFAULT_TABLE_SIZE;
1635
- g_cvfds.cvfds = (fd_node*)gpr_malloc(sizeof(fd_node) * CV_DEFAULT_TABLE_SIZE);
1612
+ g_cvfds.cvfds =
1613
+ (grpc_fd_node*)gpr_malloc(sizeof(grpc_fd_node) * CV_DEFAULT_TABLE_SIZE);
1636
1614
  g_cvfds.free_fds = nullptr;
1637
1615
  thread_grace = gpr_time_from_millis(POLLCV_THREAD_GRACE_MS, GPR_TIMESPAN);
1638
1616
  for (int i = 0; i < CV_DEFAULT_TABLE_SIZE; i++) {
@@ -1663,7 +1641,7 @@ static void global_cv_fd_table_shutdown() {
1663
1641
  // Not doing so will result in reported memory leaks
1664
1642
  if (!gpr_unref(&g_cvfds.pollcount)) {
1665
1643
  int res = gpr_cv_wait(&g_cvfds.shutdown_cv, &g_cvfds.mu,
1666
- gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
1644
+ gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
1667
1645
  gpr_time_from_seconds(3, GPR_TIMESPAN)));
1668
1646
  GPR_ASSERT(res == 0);
1669
1647
  }