grpc 1.54.3 → 1.59.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1765) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +665 -324
  3. data/include/grpc/event_engine/event_engine.h +32 -46
  4. data/include/grpc/event_engine/memory_allocator.h +2 -2
  5. data/include/grpc/grpc_audit_logging.h +96 -0
  6. data/include/grpc/grpc_security.h +19 -0
  7. data/include/grpc/impl/channel_arg_names.h +375 -0
  8. data/include/grpc/impl/grpc_types.h +1 -348
  9. data/include/grpc/module.modulemap +3 -0
  10. data/include/grpc/support/json.h +218 -0
  11. data/include/grpc/support/port_platform.h +103 -24
  12. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +7 -2
  13. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +24 -10
  14. data/src/core/ext/filters/client_channel/backend_metric.cc +4 -1
  15. data/src/core/ext/filters/client_channel/channel_connectivity.cc +4 -4
  16. data/src/core/ext/filters/client_channel/client_channel.cc +564 -178
  17. data/src/core/ext/filters/client_channel/client_channel.h +75 -23
  18. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +20 -19
  19. data/src/core/ext/filters/client_channel/client_channel_internal.h +22 -59
  20. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +15 -1
  21. data/src/core/ext/filters/client_channel/client_channel_service_config.cc +2 -2
  22. data/src/core/ext/filters/client_channel/config_selector.h +9 -36
  23. data/src/core/ext/filters/client_channel/dynamic_filters.h +5 -3
  24. data/src/core/ext/filters/client_channel/{http_proxy.cc → http_proxy_mapper.cc} +41 -3
  25. data/src/core/ext/filters/client_channel/{http_proxy.h → http_proxy_mapper.h} +3 -3
  26. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +27 -53
  27. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +23 -9
  28. data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +3 -0
  29. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +25 -35
  30. data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.cc +188 -0
  31. data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.h +214 -0
  32. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +103 -142
  33. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +2 -1
  34. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +5 -4
  35. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +4 -2
  36. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +515 -0
  37. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.h +52 -0
  38. data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +204 -0
  39. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +6 -9
  40. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +2 -0
  41. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +93 -106
  42. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +2 -2
  43. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +532 -191
  44. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +36 -0
  45. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +16 -45
  46. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +447 -464
  47. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +18 -1
  48. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +73 -129
  49. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +416 -30
  50. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +26 -23
  51. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +76 -6
  52. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +904 -101
  53. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +19 -54
  54. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +73 -126
  55. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +8 -0
  56. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +35 -86
  57. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +23 -69
  58. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +117 -173
  59. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +81 -68
  60. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +28 -96
  61. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +21 -123
  62. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.h +30 -0
  63. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +102 -11
  64. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +105 -175
  65. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +58 -44
  66. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -1
  67. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_plugin.cc +66 -0
  68. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_plugin.h +27 -0
  69. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +586 -0
  70. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.h +35 -0
  71. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/service_config_helper.cc +97 -0
  72. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/service_config_helper.h +32 -0
  73. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +3 -14
  74. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.h +24 -0
  75. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +24 -6
  76. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +36 -2
  77. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +30 -28
  78. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +10 -4
  79. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +1 -0
  80. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +25 -13
  81. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +467 -312
  82. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +32 -1
  83. data/src/core/ext/filters/client_channel/retry_filter.cc +39 -2530
  84. data/src/core/ext/filters/client_channel/retry_filter.h +92 -1
  85. data/src/core/ext/filters/client_channel/retry_filter_legacy_call_data.cc +2052 -0
  86. data/src/core/ext/filters/client_channel/retry_filter_legacy_call_data.h +442 -0
  87. data/src/core/ext/filters/client_channel/retry_service_config.cc +10 -9
  88. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +40 -90
  89. data/src/core/ext/filters/client_channel/subchannel.cc +50 -199
  90. data/src/core/ext/filters/client_channel/subchannel.h +23 -48
  91. data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -0
  92. data/src/core/ext/filters/deadline/deadline_filter.cc +1 -1
  93. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +1 -1
  94. data/src/core/ext/filters/http/client/http_client_filter.cc +1 -0
  95. data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
  96. data/src/core/ext/filters/http/message_compress/compression_filter.cc +8 -7
  97. data/src/core/ext/filters/http/server/http_server_filter.cc +22 -18
  98. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -0
  99. data/src/core/ext/filters/rbac/rbac_filter.cc +40 -111
  100. data/src/core/ext/filters/rbac/rbac_filter.h +12 -30
  101. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +162 -72
  102. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +6 -8
  103. data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +164 -88
  104. data/src/core/ext/filters/stateful_session/stateful_session_filter.h +16 -7
  105. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -0
  106. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +16 -17
  107. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +979 -832
  108. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +21 -0
  109. data/src/core/ext/transport/chttp2/transport/context_list_entry.h +70 -0
  110. data/src/core/ext/transport/chttp2/transport/decode_huff.cc +6569 -174
  111. data/src/core/ext/transport/chttp2/transport/decode_huff.h +2278 -441
  112. data/src/core/ext/transport/chttp2/transport/flow_control.cc +74 -117
  113. data/src/core/ext/transport/chttp2/transport/flow_control.h +27 -4
  114. data/src/core/ext/transport/chttp2/transport/frame_data.h +1 -1
  115. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -1
  116. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +24 -25
  117. data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -4
  118. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +10 -1
  119. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -1
  120. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -1
  121. data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -1
  122. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +1 -1
  123. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +1 -1
  124. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +1 -0
  125. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +176 -0
  126. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +326 -0
  127. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +640 -547
  128. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +160 -12
  129. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +48 -33
  130. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +19 -5
  131. data/src/core/ext/transport/chttp2/transport/internal.h +194 -149
  132. data/src/core/ext/transport/chttp2/transport/{frame.h → legacy_frame.h} +3 -3
  133. data/src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc +44 -0
  134. data/src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.h +67 -0
  135. data/src/core/ext/transport/chttp2/transport/parsing.cc +143 -31
  136. data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +90 -0
  137. data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +59 -0
  138. data/src/core/ext/transport/chttp2/transport/ping_callbacks.cc +108 -0
  139. data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +115 -0
  140. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +120 -0
  141. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +88 -0
  142. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +1 -1
  143. data/src/core/ext/transport/chttp2/transport/write_size_policy.cc +60 -0
  144. data/src/core/ext/transport/chttp2/transport/write_size_policy.h +66 -0
  145. data/src/core/ext/transport/chttp2/transport/writing.cc +220 -145
  146. data/src/core/ext/transport/inproc/inproc_transport.cc +10 -0
  147. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +85 -52
  148. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +407 -182
  149. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +119 -60
  150. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +474 -225
  151. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +88 -55
  152. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +408 -189
  153. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +355 -210
  154. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +1564 -729
  155. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +28 -17
  156. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +140 -51
  157. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +32 -21
  158. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +153 -63
  159. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +25 -14
  160. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +71 -39
  161. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +18 -11
  162. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +41 -27
  163. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +18 -11
  164. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +41 -27
  165. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +107 -62
  166. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +559 -245
  167. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +19 -12
  168. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +38 -31
  169. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +20 -19
  170. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +75 -30
  171. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +21 -16
  172. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +38 -31
  173. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +253 -147
  174. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +869 -405
  175. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +415 -264
  176. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1831 -899
  177. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +72 -41
  178. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +279 -149
  179. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +529 -334
  180. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +2009 -1131
  181. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +19 -12
  182. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +38 -31
  183. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +87 -52
  184. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +340 -233
  185. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +262 -165
  186. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +881 -477
  187. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +137 -80
  188. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +520 -275
  189. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +20 -13
  190. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +43 -37
  191. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +378 -221
  192. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1160 -611
  193. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +155 -92
  194. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +620 -293
  195. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +16 -11
  196. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +30 -27
  197. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +19 -12
  198. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +38 -31
  199. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +28 -17
  200. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +140 -51
  201. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +277 -167
  202. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +811 -441
  203. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +230 -137
  204. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +1157 -501
  205. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +20 -13
  206. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +53 -38
  207. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +367 -211
  208. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +1107 -647
  209. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +31 -18
  210. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +109 -51
  211. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +32 -19
  212. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +110 -56
  213. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +36 -21
  214. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +141 -65
  215. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +29 -18
  216. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +136 -66
  217. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +20 -13
  218. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +44 -38
  219. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +76 -43
  220. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +258 -128
  221. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +143 -88
  222. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +431 -242
  223. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +113 -62
  224. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +552 -228
  225. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +16 -11
  226. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +28 -27
  227. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +173 -118
  228. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +850 -443
  229. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +170 -95
  230. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +857 -375
  231. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +46 -27
  232. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +152 -111
  233. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +37 -18
  234. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +66 -56
  235. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +27 -15
  236. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +85 -46
  237. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +129 -74
  238. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +481 -249
  239. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +161 -84
  240. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +673 -241
  241. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +246 -139
  242. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +926 -434
  243. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +78 -49
  244. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +609 -202
  245. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +1281 -776
  246. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +5414 -2519
  247. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +47 -28
  248. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +157 -85
  249. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +226 -141
  250. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +731 -400
  251. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +18 -11
  252. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +41 -27
  253. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +19 -12
  254. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +38 -31
  255. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +30 -19
  256. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +62 -49
  257. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +25 -14
  258. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +103 -44
  259. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +44 -25
  260. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +252 -101
  261. data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +19 -12
  262. data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +38 -31
  263. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +16 -11
  264. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +28 -27
  265. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +40 -23
  266. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +101 -71
  267. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +5 -4
  268. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +14 -17
  269. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +41 -24
  270. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +103 -76
  271. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +28 -17
  272. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +88 -51
  273. data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.c +556 -0
  274. data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.h +2702 -0
  275. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +14 -9
  276. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +66 -24
  277. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +58 -37
  278. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +143 -109
  279. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +91 -43
  280. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +379 -168
  281. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +42 -25
  282. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +107 -81
  283. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +66 -22
  284. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +348 -83
  285. data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c +30 -19
  286. data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +65 -51
  287. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +502 -300
  288. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +2235 -1075
  289. data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c +16 -11
  290. data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +28 -27
  291. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +33 -21
  292. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +105 -79
  293. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +70 -45
  294. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +186 -139
  295. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.c +45 -0
  296. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +85 -0
  297. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +32 -21
  298. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +112 -79
  299. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +16 -11
  300. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +28 -27
  301. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +5 -4
  302. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +8 -11
  303. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +182 -96
  304. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +900 -361
  305. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +54 -33
  306. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +143 -102
  307. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +186 -111
  308. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +809 -420
  309. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +30 -19
  310. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +101 -53
  311. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +8 -7
  312. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +11 -15
  313. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +298 -177
  314. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +1277 -523
  315. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +40 -23
  316. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +181 -76
  317. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +128 -83
  318. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +503 -239
  319. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +20 -13
  320. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +48 -35
  321. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +37 -26
  322. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +117 -69
  323. data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +19 -12
  324. data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +40 -31
  325. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +50 -29
  326. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +85 -63
  327. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +35 -20
  328. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +126 -64
  329. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +20 -13
  330. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +84 -41
  331. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +19 -12
  332. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +43 -33
  333. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +16 -11
  334. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +30 -27
  335. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +44 -27
  336. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +94 -71
  337. data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +11 -10
  338. data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +17 -22
  339. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +38 -23
  340. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +154 -76
  341. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +29 -18
  342. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +106 -56
  343. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +44 -29
  344. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +132 -92
  345. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +63 -42
  346. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +192 -121
  347. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +78 -45
  348. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +201 -132
  349. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +32 -21
  350. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +66 -53
  351. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +5 -4
  352. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +5 -8
  353. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +14 -9
  354. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +21 -19
  355. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +26 -15
  356. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +47 -34
  357. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +41 -22
  358. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +83 -53
  359. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +33 -20
  360. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +84 -57
  361. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +5 -4
  362. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +5 -8
  363. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +18 -11
  364. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +41 -27
  365. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +21 -14
  366. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +54 -42
  367. data/src/core/ext/upb-generated/google/api/annotations.upb.c +12 -11
  368. data/src/core/ext/upb-generated/google/api/annotations.upb.h +22 -20
  369. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +253 -154
  370. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +927 -451
  371. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +297 -180
  372. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +939 -484
  373. data/src/core/ext/upb-generated/google/api/http.upb.c +66 -35
  374. data/src/core/ext/upb-generated/google/api/http.upb.h +277 -121
  375. data/src/core/ext/upb-generated/google/api/httpbody.upb.c +20 -13
  376. data/src/core/ext/upb-generated/google/api/httpbody.upb.h +88 -38
  377. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +17 -10
  378. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +31 -23
  379. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +1168 -419
  380. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +4431 -1412
  381. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +17 -10
  382. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +31 -23
  383. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +8 -7
  384. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +11 -15
  385. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +60 -39
  386. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +200 -103
  387. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +17 -10
  388. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +31 -23
  389. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +88 -51
  390. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +149 -107
  391. data/src/core/ext/upb-generated/google/rpc/status.upb.c +20 -13
  392. data/src/core/ext/upb-generated/google/rpc/status.upb.h +88 -38
  393. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +57 -34
  394. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +147 -93
  395. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +41 -24
  396. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +110 -60
  397. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +248 -145
  398. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +912 -416
  399. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +32 -19
  400. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +68 -51
  401. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +23 -14
  402. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +37 -30
  403. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +142 -81
  404. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +397 -217
  405. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +49 -26
  406. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +146 -62
  407. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +171 -102
  408. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +848 -299
  409. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +66 -49
  410. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +148 -105
  411. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +24 -17
  412. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +48 -35
  413. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +10 -9
  414. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +23 -14
  415. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +24 -17
  416. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +48 -35
  417. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +21 -16
  418. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +38 -31
  419. data/src/core/ext/upb-generated/validate/validate.upb.c +843 -455
  420. data/src/core/ext/upb-generated/validate/validate.upb.h +4340 -1909
  421. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +66 -49
  422. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +148 -105
  423. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +24 -17
  424. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +48 -35
  425. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +10 -9
  426. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +23 -14
  427. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +63 -44
  428. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +130 -92
  429. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +21 -16
  430. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +38 -31
  431. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +14 -9
  432. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +21 -19
  433. data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c +19 -12
  434. data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h +38 -31
  435. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +35 -22
  436. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +88 -63
  437. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +24 -17
  438. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +44 -29
  439. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +19 -12
  440. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +38 -31
  441. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +21 -14
  442. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +55 -43
  443. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +42 -25
  444. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +162 -80
  445. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +25 -14
  446. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +58 -39
  447. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +76 -38
  448. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +175 -77
  449. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +19 -12
  450. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +82 -35
  451. data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c +16 -11
  452. data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h +28 -27
  453. data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c +30 -19
  454. data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h +143 -55
  455. data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c +8 -7
  456. data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h +11 -15
  457. data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c +32 -21
  458. data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h +154 -64
  459. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +160 -101
  460. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +494 -294
  461. data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c +83 -52
  462. data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h +423 -165
  463. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +22 -15
  464. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +45 -37
  465. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +38 -23
  466. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +154 -76
  467. data/src/core/ext/upb-generated/xds/type/v3/cel.upb.c +35 -22
  468. data/src/core/ext/upb-generated/xds/type/v3/cel.upb.h +84 -66
  469. data/src/core/ext/upb-generated/xds/type/v3/range.upb.c +41 -22
  470. data/src/core/ext/upb-generated/xds/type/v3/range.upb.h +83 -53
  471. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +19 -12
  472. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +38 -31
  473. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +1 -1
  474. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +6 -5
  475. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +1 -1
  476. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +6 -5
  477. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +1 -1
  478. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +6 -5
  479. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +1 -1
  480. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +6 -5
  481. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +1 -1
  482. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +6 -5
  483. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +1 -1
  484. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +6 -5
  485. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +1 -1
  486. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +6 -5
  487. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +1 -1
  488. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +6 -5
  489. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +1 -1
  490. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +6 -5
  491. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +1 -1
  492. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +6 -5
  493. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +1 -1
  494. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +6 -5
  495. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +1 -1
  496. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +6 -5
  497. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +1 -1
  498. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +6 -5
  499. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +89 -77
  500. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +11 -5
  501. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +252 -253
  502. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +6 -5
  503. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +1 -1
  504. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +6 -5
  505. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +1 -1
  506. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +6 -5
  507. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +1 -1
  508. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +6 -5
  509. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +1 -1
  510. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +6 -5
  511. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +1 -1
  512. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +6 -5
  513. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +1 -1
  514. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +6 -5
  515. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +1 -1
  516. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +6 -5
  517. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +1 -1
  518. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +6 -5
  519. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +1 -1
  520. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +6 -5
  521. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +1 -1
  522. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +6 -5
  523. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +1 -1
  524. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +6 -5
  525. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +1 -1
  526. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +6 -5
  527. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +163 -161
  528. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +6 -5
  529. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +130 -119
  530. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +6 -5
  531. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +1 -1
  532. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +6 -5
  533. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +142 -136
  534. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +6 -5
  535. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +1 -1
  536. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +6 -5
  537. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +1 -1
  538. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +6 -5
  539. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +1 -1
  540. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +6 -5
  541. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +1 -1
  542. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +6 -5
  543. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +1 -1
  544. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +6 -5
  545. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +1 -1
  546. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +6 -5
  547. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +1 -1
  548. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +6 -5
  549. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +1 -1
  550. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +6 -5
  551. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +1 -1
  552. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +6 -5
  553. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +1 -1
  554. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +6 -5
  555. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +1 -1
  556. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +6 -5
  557. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +1 -1
  558. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +6 -5
  559. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +1 -1
  560. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +6 -5
  561. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +20 -13
  562. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +6 -5
  563. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +1 -1
  564. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +6 -5
  565. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +39 -31
  566. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +11 -5
  567. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +134 -128
  568. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +11 -5
  569. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +1 -1
  570. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +6 -5
  571. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +1 -1
  572. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +6 -5
  573. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +1 -1
  574. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +6 -5
  575. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +1 -1
  576. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +6 -5
  577. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +1 -1
  578. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +6 -5
  579. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +1 -1
  580. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +6 -5
  581. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +1 -1
  582. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +6 -5
  583. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +1 -1
  584. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +6 -5
  585. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +1 -1
  586. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +6 -5
  587. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +1 -1
  588. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h +6 -5
  589. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +1 -1
  590. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +6 -5
  591. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +1 -1
  592. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +6 -5
  593. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +1 -1
  594. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +6 -5
  595. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +1 -1
  596. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +6 -5
  597. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +1 -1
  598. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +6 -5
  599. data/src/core/ext/upbdefs-generated/envoy/data/accesslog/v3/accesslog.upbdefs.c +402 -0
  600. data/src/core/ext/upbdefs-generated/envoy/data/accesslog/v3/accesslog.upbdefs.h +111 -0
  601. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +1 -1
  602. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +6 -5
  603. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +1 -1
  604. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +6 -5
  605. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +81 -75
  606. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +6 -5
  607. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +1 -1
  608. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +6 -5
  609. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +64 -48
  610. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +11 -5
  611. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +1 -1
  612. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h +6 -5
  613. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +495 -470
  614. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +11 -5
  615. data/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c +1 -1
  616. data/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h +6 -5
  617. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +1 -1
  618. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +6 -5
  619. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +138 -136
  620. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +6 -5
  621. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +1 -1
  622. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +6 -5
  623. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +1 -1
  624. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +6 -5
  625. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +1 -1
  626. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +6 -5
  627. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +1 -1
  628. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +6 -5
  629. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +1 -1
  630. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +6 -5
  631. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +1 -1
  632. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +6 -5
  633. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +12 -13
  634. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +6 -5
  635. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +1 -1
  636. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +6 -5
  637. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +1 -1
  638. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +6 -5
  639. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +1 -1
  640. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +6 -5
  641. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +1 -1
  642. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +6 -5
  643. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +1 -1
  644. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +6 -5
  645. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +1 -1
  646. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +6 -5
  647. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +1 -1
  648. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +6 -5
  649. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +1 -1
  650. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +6 -5
  651. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +30 -30
  652. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +6 -5
  653. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +1 -1
  654. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +6 -5
  655. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +1 -1
  656. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +6 -5
  657. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +1 -1
  658. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +6 -5
  659. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +1 -1
  660. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +6 -5
  661. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +1 -1
  662. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +6 -5
  663. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +1 -1
  664. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +6 -5
  665. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +1 -1
  666. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +6 -5
  667. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +1 -1
  668. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +6 -5
  669. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +1 -1
  670. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +6 -5
  671. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +1 -1
  672. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +6 -5
  673. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +1 -1
  674. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +6 -5
  675. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c +1 -1
  676. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h +6 -5
  677. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +1 -1
  678. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +6 -5
  679. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +1 -1
  680. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +6 -5
  681. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +1 -1
  682. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +6 -5
  683. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +1 -1
  684. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +6 -5
  685. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +1 -1
  686. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +6 -5
  687. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +1 -1
  688. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +6 -5
  689. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +1 -1
  690. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +6 -5
  691. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +1 -1
  692. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +6 -5
  693. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +1 -1
  694. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +6 -5
  695. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +406 -273
  696. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +21 -5
  697. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +1 -1
  698. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +6 -5
  699. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +1 -1
  700. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +6 -5
  701. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +1 -1
  702. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +6 -5
  703. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +1 -1
  704. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +6 -5
  705. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +1 -1
  706. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +6 -5
  707. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +1 -1
  708. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +6 -5
  709. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +1 -1
  710. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +6 -5
  711. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +1 -1
  712. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +6 -5
  713. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +1 -1
  714. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +6 -5
  715. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +1 -1
  716. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +6 -5
  717. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +1 -1
  718. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +6 -5
  719. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +1 -1
  720. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +6 -5
  721. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +1 -1
  722. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +6 -5
  723. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +1 -1
  724. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +6 -5
  725. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +1 -1
  726. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +6 -5
  727. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +1 -1
  728. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +6 -5
  729. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +1 -1
  730. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +6 -5
  731. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +1 -1
  732. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +6 -5
  733. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +1 -1
  734. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +6 -5
  735. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +1 -1
  736. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +6 -5
  737. data/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.c +1 -1
  738. data/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.h +6 -5
  739. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +1 -1
  740. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +6 -5
  741. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +1 -1
  742. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +6 -5
  743. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +1 -1
  744. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +6 -5
  745. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +1 -1
  746. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +6 -5
  747. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +1 -1
  748. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +6 -5
  749. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +1 -1
  750. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +6 -5
  751. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.c +1 -1
  752. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.h +6 -5
  753. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.c +1 -1
  754. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.h +6 -5
  755. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.c +1 -1
  756. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.h +6 -5
  757. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.c +1 -1
  758. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.h +6 -5
  759. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +1 -1
  760. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +6 -5
  761. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.c +1 -1
  762. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.h +6 -5
  763. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +1 -1
  764. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +6 -5
  765. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +1 -1
  766. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +6 -5
  767. data/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.c +1 -1
  768. data/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.h +6 -5
  769. data/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.c +1 -1
  770. data/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.h +6 -5
  771. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +1 -1
  772. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +6 -5
  773. data/src/core/ext/xds/certificate_provider_store.cc +8 -13
  774. data/src/core/ext/xds/certificate_provider_store.h +1 -1
  775. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +30 -42
  776. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +14 -9
  777. data/src/core/ext/xds/upb_utils.h +1 -1
  778. data/src/core/ext/xds/xds_api.cc +41 -18
  779. data/src/core/ext/xds/xds_api.h +5 -4
  780. data/src/core/ext/xds/xds_audit_logger_registry.cc +122 -0
  781. data/src/core/ext/xds/xds_audit_logger_registry.h +68 -0
  782. data/src/core/ext/xds/xds_bootstrap.cc +3 -3
  783. data/src/core/ext/xds/xds_bootstrap_grpc.cc +65 -50
  784. data/src/core/ext/xds/xds_bootstrap_grpc.h +10 -13
  785. data/src/core/ext/xds/xds_client.cc +35 -16
  786. data/src/core/ext/xds/xds_client.h +3 -3
  787. data/src/core/ext/xds/xds_client_grpc.cc +12 -6
  788. data/src/core/ext/xds/xds_client_grpc.h +16 -2
  789. data/src/core/ext/xds/xds_client_stats.h +11 -1
  790. data/src/core/ext/xds/xds_cluster.cc +100 -109
  791. data/src/core/ext/xds/xds_cluster.h +1 -6
  792. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +15 -11
  793. data/src/core/ext/xds/xds_cluster_specifier_plugin.h +2 -2
  794. data/src/core/ext/xds/xds_common_types.cc +8 -5
  795. data/src/core/ext/xds/xds_endpoint.cc +21 -28
  796. data/src/core/ext/xds/xds_endpoint.h +1 -2
  797. data/src/core/ext/xds/xds_health_status.cc +0 -17
  798. data/src/core/ext/xds/xds_health_status.h +5 -25
  799. data/src/core/ext/xds/xds_http_fault_filter.cc +16 -14
  800. data/src/core/ext/xds/xds_http_fault_filter.h +1 -1
  801. data/src/core/ext/xds/xds_http_filters.cc +1 -4
  802. data/src/core/ext/xds/xds_http_filters.h +3 -2
  803. data/src/core/ext/xds/xds_http_rbac_filter.cc +152 -72
  804. data/src/core/ext/xds/xds_http_rbac_filter.h +1 -1
  805. data/src/core/ext/xds/xds_http_stateful_session_filter.cc +16 -16
  806. data/src/core/ext/xds/xds_http_stateful_session_filter.h +1 -1
  807. data/src/core/ext/xds/xds_lb_policy_registry.cc +60 -36
  808. data/src/core/ext/xds/xds_listener.cc +25 -18
  809. data/src/core/ext/xds/xds_listener.h +14 -4
  810. data/src/core/ext/xds/xds_resource_type.h +3 -9
  811. data/src/core/ext/xds/xds_resource_type_impl.h +9 -11
  812. data/src/core/ext/xds/xds_route_config.cc +62 -19
  813. data/src/core/ext/xds/xds_route_config.h +2 -2
  814. data/src/core/ext/xds/xds_server_config_fetcher.cc +53 -28
  815. data/src/core/ext/xds/xds_transport_grpc.cc +13 -2
  816. data/src/core/lib/address_utils/parse_address.cc +63 -1
  817. data/src/core/lib/address_utils/parse_address.h +8 -0
  818. data/src/core/lib/address_utils/sockaddr_utils.cc +46 -1
  819. data/src/core/lib/address_utils/sockaddr_utils.h +2 -2
  820. data/src/core/lib/avl/avl.h +15 -173
  821. data/src/core/lib/backoff/random_early_detection.cc +4 -2
  822. data/src/core/lib/backoff/random_early_detection.h +7 -4
  823. data/src/core/lib/channel/call_tracer.cc +296 -1
  824. data/src/core/lib/channel/call_tracer.h +39 -1
  825. data/src/core/lib/channel/channel_args.cc +120 -46
  826. data/src/core/lib/channel/channel_args.h +52 -4
  827. data/src/core/lib/channel/channel_trace.cc +16 -12
  828. data/src/core/lib/channel/channelz.cc +163 -135
  829. data/src/core/lib/channel/channelz.h +42 -35
  830. data/src/core/lib/channel/channelz_registry.cc +24 -20
  831. data/src/core/lib/channel/channelz_registry.h +4 -2
  832. data/src/core/lib/channel/connected_channel.cc +103 -35
  833. data/src/core/lib/channel/promise_based_filter.cc +15 -17
  834. data/src/core/lib/channel/promise_based_filter.h +5 -1
  835. data/src/core/lib/compression/compression_internal.cc +8 -7
  836. data/src/core/lib/config/config_vars.cc +20 -18
  837. data/src/core/lib/config/config_vars.h +5 -5
  838. data/src/core/lib/config/core_configuration.cc +2 -1
  839. data/src/core/lib/config/core_configuration.h +5 -4
  840. data/src/core/lib/config/load_config.cc +13 -0
  841. data/src/core/lib/config/load_config.h +6 -0
  842. data/src/core/lib/debug/event_log.h +1 -1
  843. data/src/core/lib/debug/stats_data.cc +202 -35
  844. data/src/core/lib/debug/stats_data.h +103 -1
  845. data/src/core/lib/debug/trace.cc +31 -56
  846. data/src/core/lib/debug/trace.h +14 -4
  847. data/src/core/lib/event_engine/ares_resolver.cc +721 -0
  848. data/src/core/lib/event_engine/ares_resolver.h +150 -0
  849. data/src/core/lib/event_engine/cf_engine/cf_engine.cc +221 -0
  850. data/src/core/lib/event_engine/cf_engine/cf_engine.h +89 -0
  851. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +357 -0
  852. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +149 -0
  853. data/src/core/lib/event_engine/cf_engine/cftype_unique_ref.h +82 -0
  854. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +241 -0
  855. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +120 -0
  856. data/src/core/lib/event_engine/default_event_engine.cc +13 -1
  857. data/src/core/lib/event_engine/default_event_engine_factory.cc +14 -2
  858. data/src/core/lib/event_engine/event_engine.cc +0 -12
  859. data/src/core/lib/event_engine/forkable.cc +62 -43
  860. data/src/core/lib/event_engine/forkable.h +15 -0
  861. data/src/core/lib/event_engine/grpc_polled_fd.h +73 -0
  862. data/src/core/lib/event_engine/handle_containers.h +0 -4
  863. data/src/core/lib/event_engine/nameser.h +102 -0
  864. data/src/core/lib/event_engine/poller.h +2 -2
  865. data/src/core/lib/event_engine/posix.h +4 -0
  866. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +5 -7
  867. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +29 -9
  868. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +10 -1
  869. data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +197 -0
  870. data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +7 -18
  871. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +28 -14
  872. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +12 -1
  873. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +90 -47
  874. data/src/core/lib/event_engine/posix_engine/posix_engine.h +21 -14
  875. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +41 -31
  876. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +9 -8
  877. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +4 -2
  878. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +50 -4
  879. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +9 -0
  880. data/src/core/lib/event_engine/posix_engine/timer.h +10 -37
  881. data/src/core/lib/event_engine/posix_engine/timer_manager.h +1 -1
  882. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +2 -0
  883. data/src/core/lib/event_engine/shim.cc +9 -1
  884. data/src/core/lib/event_engine/tcp_socket_utils.cc +67 -7
  885. data/src/core/lib/event_engine/tcp_socket_utils.h +3 -0
  886. data/src/core/lib/event_engine/thread_pool/thread_count.cc +58 -0
  887. data/src/core/lib/event_engine/thread_pool/thread_count.h +176 -0
  888. data/src/core/lib/event_engine/thread_pool/thread_pool.h +50 -0
  889. data/src/core/lib/event_engine/{executor/executor.h → thread_pool/thread_pool_factory.cc} +12 -15
  890. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +523 -0
  891. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +223 -0
  892. data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +157 -0
  893. data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +104 -0
  894. data/src/core/lib/event_engine/trace.cc +1 -0
  895. data/src/core/lib/event_engine/trace.h +6 -0
  896. data/src/core/lib/event_engine/windows/iocp.cc +4 -3
  897. data/src/core/lib/event_engine/windows/iocp.h +3 -3
  898. data/src/core/lib/event_engine/windows/win_socket.cc +6 -6
  899. data/src/core/lib/event_engine/windows/win_socket.h +4 -4
  900. data/src/core/lib/event_engine/windows/windows_endpoint.cc +60 -59
  901. data/src/core/lib/event_engine/windows/windows_endpoint.h +17 -13
  902. data/src/core/lib/event_engine/windows/windows_engine.cc +21 -18
  903. data/src/core/lib/event_engine/windows/windows_engine.h +14 -18
  904. data/src/core/lib/event_engine/windows/windows_listener.cc +3 -3
  905. data/src/core/lib/event_engine/windows/windows_listener.h +3 -2
  906. data/src/core/lib/event_engine/work_queue/basic_work_queue.cc +63 -0
  907. data/src/core/lib/event_engine/work_queue/basic_work_queue.h +71 -0
  908. data/src/core/lib/event_engine/work_queue/work_queue.h +62 -0
  909. data/src/core/lib/experiments/config.cc +121 -30
  910. data/src/core/lib/experiments/config.h +33 -5
  911. data/src/core/lib/experiments/experiments.cc +675 -23
  912. data/src/core/lib/experiments/experiments.h +342 -27
  913. data/src/core/lib/gpr/log_internal.h +55 -0
  914. data/src/core/lib/gpr/posix/time.cc +5 -0
  915. data/src/core/lib/gprpp/crash.cc +10 -0
  916. data/src/core/lib/gprpp/crash.h +3 -0
  917. data/src/core/lib/gprpp/dual_ref_counted.h +9 -9
  918. data/src/core/lib/gprpp/fork.cc +8 -9
  919. data/src/core/lib/gprpp/fork.h +7 -6
  920. data/src/core/lib/gprpp/if_list.h +4530 -0
  921. data/src/core/lib/gprpp/manual_constructor.h +1 -2
  922. data/src/core/lib/gprpp/no_destruct.h +1 -1
  923. data/src/core/lib/gprpp/orphanable.h +3 -3
  924. data/src/core/lib/gprpp/per_cpu.cc +35 -0
  925. data/src/core/lib/gprpp/per_cpu.h +61 -9
  926. data/src/core/lib/gprpp/ref_counted.h +9 -7
  927. data/src/core/lib/gprpp/ref_counted_ptr.h +63 -0
  928. data/src/core/lib/gprpp/ref_counted_string.cc +44 -0
  929. data/src/core/lib/gprpp/ref_counted_string.h +146 -0
  930. data/src/core/lib/gprpp/sorted_pack.h +3 -12
  931. data/src/core/lib/gprpp/status_helper.cc +2 -2
  932. data/src/core/lib/gprpp/status_helper.h +16 -15
  933. data/src/core/lib/gprpp/time.cc +1 -0
  934. data/src/core/lib/gprpp/time.h +13 -1
  935. data/src/core/lib/gprpp/type_list.h +32 -0
  936. data/src/core/lib/gprpp/validation_errors.cc +8 -3
  937. data/src/core/lib/gprpp/validation_errors.h +16 -9
  938. data/src/core/lib/gprpp/work_serializer.cc +320 -12
  939. data/src/core/lib/gprpp/work_serializer.h +30 -9
  940. data/src/core/lib/http/httpcli.h +6 -9
  941. data/src/core/lib/http/httpcli_security_connector.cc +1 -0
  942. data/src/core/lib/iomgr/buffer_list.cc +2 -0
  943. data/src/core/lib/iomgr/buffer_list.h +0 -1
  944. data/src/core/lib/iomgr/cfstream_handle.cc +1 -1
  945. data/src/core/lib/iomgr/combiner.cc +57 -15
  946. data/src/core/lib/iomgr/combiner.h +8 -3
  947. data/src/core/lib/iomgr/endpoint_cfstream.cc +10 -8
  948. data/src/core/lib/iomgr/error.cc +32 -2
  949. data/src/core/lib/iomgr/error.h +9 -10
  950. data/src/core/lib/iomgr/ev_apple.cc +12 -12
  951. data/src/core/lib/iomgr/ev_epoll1_linux.cc +15 -10
  952. data/src/core/lib/iomgr/ev_poll_posix.cc +6 -5
  953. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +24 -27
  954. data/src/core/lib/iomgr/exec_ctx.cc +12 -0
  955. data/src/core/lib/iomgr/exec_ctx.h +66 -19
  956. data/src/core/lib/iomgr/iocp_windows.cc +24 -3
  957. data/src/core/lib/iomgr/iocp_windows.h +11 -0
  958. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +1 -1
  959. data/src/core/lib/iomgr/polling_entity.cc +10 -0
  960. data/src/core/lib/iomgr/polling_entity.h +2 -0
  961. data/src/core/lib/iomgr/pollset.h +4 -5
  962. data/src/core/lib/iomgr/port.h +24 -0
  963. data/src/core/lib/iomgr/resolve_address.cc +13 -1
  964. data/src/core/lib/iomgr/resolve_address.h +17 -3
  965. data/src/core/lib/iomgr/sockaddr_posix.h +7 -0
  966. data/src/core/lib/iomgr/socket_utils_common_posix.cc +33 -2
  967. data/src/core/lib/iomgr/socket_utils_posix.cc +5 -0
  968. data/src/core/lib/iomgr/socket_utils_posix.h +9 -0
  969. data/src/core/lib/iomgr/socket_windows.cc +61 -7
  970. data/src/core/lib/iomgr/socket_windows.h +9 -2
  971. data/src/core/lib/iomgr/tcp_client_cfstream.cc +14 -3
  972. data/src/core/lib/iomgr/tcp_client_posix.cc +8 -1
  973. data/src/core/lib/iomgr/tcp_posix.cc +41 -21
  974. data/src/core/lib/iomgr/tcp_server_posix.cc +145 -106
  975. data/src/core/lib/iomgr/tcp_server_utils_posix.h +1 -1
  976. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +5 -2
  977. data/src/core/lib/iomgr/tcp_server_windows.cc +1 -1
  978. data/src/core/lib/iomgr/tcp_windows.cc +1 -3
  979. data/src/core/lib/iomgr/timer_generic.cc +17 -16
  980. data/src/core/lib/iomgr/vsock.cc +59 -0
  981. data/src/core/lib/iomgr/vsock.h +38 -0
  982. data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -6
  983. data/src/core/lib/json/json.h +2 -218
  984. data/src/core/lib/json/json_object_loader.cc +24 -25
  985. data/src/core/lib/json/json_object_loader.h +30 -18
  986. data/src/core/lib/json/json_reader.cc +69 -42
  987. data/src/core/lib/json/json_reader.h +34 -0
  988. data/src/core/lib/json/json_util.cc +10 -15
  989. data/src/core/lib/json/json_util.h +5 -4
  990. data/src/core/lib/json/json_writer.cc +24 -25
  991. data/src/core/lib/json/json_writer.h +33 -0
  992. data/src/core/lib/load_balancing/delegating_helper.h +115 -0
  993. data/src/core/lib/load_balancing/lb_policy.h +43 -9
  994. data/src/core/lib/load_balancing/lb_policy_registry.cc +9 -8
  995. data/src/core/lib/load_balancing/subchannel_interface.h +6 -0
  996. data/src/core/lib/matchers/matchers.cc +3 -4
  997. data/src/core/lib/matchers/matchers.h +2 -1
  998. data/src/core/lib/promise/activity.cc +5 -0
  999. data/src/core/lib/promise/activity.h +10 -0
  1000. data/src/core/lib/promise/arena_promise.h +5 -1
  1001. data/src/core/lib/promise/detail/basic_seq.h +1 -372
  1002. data/src/core/lib/promise/detail/promise_factory.h +1 -1
  1003. data/src/core/lib/promise/detail/seq_state.h +2494 -0
  1004. data/src/core/lib/promise/latch.h +1 -0
  1005. data/src/core/lib/promise/loop.h +8 -5
  1006. data/src/core/lib/promise/party.cc +31 -13
  1007. data/src/core/lib/promise/party.h +12 -3
  1008. data/src/core/lib/promise/pipe.h +40 -26
  1009. data/src/core/lib/promise/poll.h +4 -6
  1010. data/src/core/lib/promise/prioritized_race.h +95 -0
  1011. data/src/core/lib/promise/seq.h +19 -2
  1012. data/src/core/lib/promise/sleep.cc +2 -1
  1013. data/src/core/lib/promise/sleep.h +5 -10
  1014. data/src/core/lib/promise/try_seq.h +34 -2
  1015. data/src/core/lib/resolver/resolver_factory.h +3 -2
  1016. data/src/core/lib/resolver/server_address.cc +9 -102
  1017. data/src/core/lib/resolver/server_address.h +11 -70
  1018. data/src/core/lib/resource_quota/api.cc +1 -0
  1019. data/src/core/lib/resource_quota/arena.cc +2 -0
  1020. data/src/core/lib/resource_quota/arena.h +42 -8
  1021. data/src/core/lib/resource_quota/memory_quota.cc +65 -10
  1022. data/src/core/lib/resource_quota/memory_quota.h +6 -4
  1023. data/src/core/lib/resource_quota/resource_quota.h +1 -0
  1024. data/src/core/lib/security/authorization/audit_logging.cc +98 -0
  1025. data/src/core/lib/security/authorization/audit_logging.h +73 -0
  1026. data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
  1027. data/src/core/lib/security/authorization/grpc_authorization_engine.cc +47 -2
  1028. data/src/core/lib/security/authorization/grpc_authorization_engine.h +18 -1
  1029. data/src/core/lib/security/authorization/rbac_policy.cc +36 -4
  1030. data/src/core/lib/security/authorization/rbac_policy.h +19 -2
  1031. data/src/core/lib/security/authorization/stdout_logger.cc +75 -0
  1032. data/src/core/lib/security/authorization/stdout_logger.h +61 -0
  1033. data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +8 -4
  1034. data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +8 -18
  1035. data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +14 -8
  1036. data/src/core/lib/security/credentials/channel_creds_registry.h +51 -27
  1037. data/src/core/lib/security/credentials/channel_creds_registry_init.cc +169 -9
  1038. data/src/core/lib/security/credentials/composite/composite_credentials.cc +1 -1
  1039. data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -1
  1040. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +54 -49
  1041. data/src/core/lib/security/credentials/external/aws_request_signer.cc +8 -0
  1042. data/src/core/lib/security/credentials/external/external_account_credentials.cc +104 -65
  1043. data/src/core/lib/security/credentials/external/external_account_credentials.h +6 -0
  1044. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +23 -21
  1045. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +29 -27
  1046. data/src/core/lib/security/credentials/fake/fake_credentials.cc +30 -38
  1047. data/src/core/lib/security/credentials/fake/fake_credentials.h +28 -0
  1048. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +6 -2
  1049. data/src/core/lib/security/credentials/jwt/json_token.cc +36 -16
  1050. data/src/core/lib/security/credentials/jwt/json_token.h +4 -0
  1051. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +10 -5
  1052. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +82 -38
  1053. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +18 -16
  1054. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +116 -9
  1055. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +14 -0
  1056. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_match.cc +86 -0
  1057. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +0 -55
  1058. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +2 -0
  1059. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +8 -0
  1060. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +5 -1
  1061. data/src/core/lib/security/credentials/tls/tls_credentials.cc +2 -1
  1062. data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -1
  1063. data/src/core/lib/security/credentials/xds/xds_credentials.cc +1 -0
  1064. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +2 -5
  1065. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
  1066. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +7 -57
  1067. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -1
  1068. data/src/core/lib/security/security_connector/ssl_utils.cc +3 -1
  1069. data/src/core/lib/security/security_connector/ssl_utils.h +1 -1
  1070. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +3 -15
  1071. data/src/core/lib/security/transport/client_auth_filter.cc +8 -5
  1072. data/src/core/lib/security/transport/security_handshaker.cc +1 -0
  1073. data/src/core/lib/security/transport/server_auth_filter.cc +2 -0
  1074. data/src/core/lib/security/util/json_util.cc +6 -5
  1075. data/src/core/lib/service_config/service_config_call_data.h +54 -20
  1076. data/src/core/lib/service_config/service_config_impl.cc +13 -6
  1077. data/src/core/lib/slice/slice.h +24 -0
  1078. data/src/core/lib/slice/slice_buffer.cc +15 -0
  1079. data/src/core/lib/slice/slice_buffer.h +16 -4
  1080. data/src/core/lib/slice/slice_refcount.h +1 -1
  1081. data/src/core/lib/surface/call.cc +244 -100
  1082. data/src/core/lib/surface/call.h +5 -5
  1083. data/src/core/lib/surface/channel.cc +8 -4
  1084. data/src/core/lib/surface/channel_init.h +3 -2
  1085. data/src/core/lib/surface/completion_queue.cc +18 -3
  1086. data/src/core/lib/surface/init.cc +1 -0
  1087. data/src/core/lib/surface/server.cc +151 -80
  1088. data/src/core/lib/surface/server.h +19 -21
  1089. data/src/core/lib/surface/validate_metadata.cc +37 -22
  1090. data/src/core/lib/surface/validate_metadata.h +13 -3
  1091. data/src/core/lib/surface/version.cc +2 -2
  1092. data/src/core/lib/transport/batch_builder.cc +16 -15
  1093. data/src/core/lib/transport/batch_builder.h +48 -36
  1094. data/src/core/lib/transport/metadata_batch.cc +13 -7
  1095. data/src/core/lib/transport/metadata_batch.h +118 -108
  1096. data/src/core/lib/transport/metadata_compression_traits.h +67 -0
  1097. data/src/core/lib/transport/parsed_metadata.h +32 -20
  1098. data/src/core/lib/transport/simple_slice_based_metadata.h +54 -0
  1099. data/src/core/lib/transport/transport.h +30 -11
  1100. data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -6
  1101. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
  1102. data/src/core/tsi/alts/crypt/aes_gcm.cc +27 -2
  1103. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +4 -6
  1104. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +1 -2
  1105. data/src/core/tsi/ssl_transport_security.cc +51 -9
  1106. data/src/core/tsi/ssl_transport_security.h +17 -1
  1107. data/src/ruby/bin/math_pb.rb +24 -18
  1108. data/src/ruby/ext/grpc/extconf.rb +27 -27
  1109. data/src/ruby/ext/grpc/rb_call.c +62 -39
  1110. data/src/ruby/ext/grpc/rb_call_credentials.c +0 -1
  1111. data/src/ruby/ext/grpc/rb_channel.c +109 -84
  1112. data/src/ruby/ext/grpc/rb_channel.h +1 -0
  1113. data/src/ruby/ext/grpc/rb_channel_args.c +18 -2
  1114. data/src/ruby/ext/grpc/rb_channel_args.h +4 -0
  1115. data/src/ruby/ext/grpc/rb_channel_credentials.c +0 -1
  1116. data/src/ruby/ext/grpc/rb_compression_options.c +0 -1
  1117. data/src/ruby/ext/grpc/rb_event_thread.c +22 -6
  1118. data/src/ruby/ext/grpc/rb_event_thread.h +1 -0
  1119. data/src/ruby/ext/grpc/rb_grpc.c +192 -30
  1120. data/src/ruby/ext/grpc/rb_grpc.h +8 -2
  1121. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
  1122. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +3 -0
  1123. data/src/ruby/ext/grpc/rb_server.c +62 -45
  1124. data/src/ruby/ext/grpc/rb_server_credentials.c +0 -1
  1125. data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +0 -1
  1126. data/src/ruby/ext/grpc/rb_xds_server_credentials.c +0 -1
  1127. data/src/ruby/lib/grpc/generic/active_call.rb +9 -14
  1128. data/src/ruby/lib/grpc/generic/bidi_call.rb +2 -0
  1129. data/src/ruby/lib/grpc/version.rb +1 -1
  1130. data/src/ruby/pb/grpc/health/v1/health_pb.rb +24 -13
  1131. data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +24 -3
  1132. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +28 -111
  1133. data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +25 -2
  1134. data/src/ruby/pb/test/client.rb +16 -0
  1135. data/src/ruby/spec/generic/rpc_server_spec.rb +3 -3
  1136. data/third_party/abseil-cpp/absl/algorithm/container.h +3 -2
  1137. data/third_party/abseil-cpp/absl/base/attributes.h +58 -5
  1138. data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
  1139. data/third_party/abseil-cpp/absl/base/casts.h +8 -8
  1140. data/third_party/abseil-cpp/absl/base/config.h +89 -106
  1141. data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +26 -1
  1142. data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -2
  1143. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +50 -39
  1144. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +2 -1
  1145. data/third_party/abseil-cpp/absl/base/internal/prefetch.h +17 -18
  1146. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +32 -3
  1147. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +24 -4
  1148. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +31 -73
  1149. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +9 -8
  1150. data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +11 -11
  1151. data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +23 -32
  1152. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +2 -3
  1153. data/third_party/abseil-cpp/absl/base/options.h +1 -1
  1154. data/third_party/abseil-cpp/absl/base/policy_checks.h +3 -3
  1155. data/third_party/abseil-cpp/absl/base/prefetch.h +198 -0
  1156. data/third_party/abseil-cpp/absl/container/fixed_array.h +54 -29
  1157. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -1
  1158. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -2
  1159. data/third_party/abseil-cpp/absl/container/inlined_vector.h +167 -79
  1160. data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
  1161. data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +3 -21
  1162. data/third_party/abseil-cpp/absl/container/internal/container_memory.h +1 -1
  1163. data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +46 -0
  1164. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -0
  1165. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +85 -26
  1166. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +35 -18
  1167. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +70 -29
  1168. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +437 -236
  1169. data/third_party/abseil-cpp/absl/crc/crc32c.h +8 -1
  1170. data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +14 -8
  1171. data/third_party/abseil-cpp/absl/crc/internal/crc.cc +4 -35
  1172. data/third_party/abseil-cpp/absl/crc/internal/crc.h +2 -10
  1173. data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +1 -1
  1174. data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +1 -1
  1175. data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +4 -4
  1176. data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +8 -10
  1177. data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +17 -19
  1178. data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +8 -8
  1179. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +2 -1
  1180. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +59 -23
  1181. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +1 -1
  1182. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +1 -1
  1183. data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +1 -1
  1184. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +43 -19
  1185. data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -0
  1186. data/third_party/abseil-cpp/absl/flags/commandlineflag.h +1 -1
  1187. data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc +1 -1
  1188. data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -2
  1189. data/third_party/abseil-cpp/absl/flags/internal/flag.h +16 -15
  1190. data/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc +1 -1
  1191. data/third_party/abseil-cpp/absl/flags/marshalling.cc +43 -2
  1192. data/third_party/abseil-cpp/absl/flags/marshalling.h +5 -0
  1193. data/third_party/abseil-cpp/absl/functional/any_invocable.h +9 -1
  1194. data/third_party/abseil-cpp/absl/functional/bind_front.h +1 -1
  1195. data/third_party/abseil-cpp/absl/functional/function_ref.h +3 -3
  1196. data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +37 -24
  1197. data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +19 -9
  1198. data/third_party/abseil-cpp/absl/hash/hash.h +7 -4
  1199. data/third_party/abseil-cpp/absl/hash/internal/hash.h +38 -15
  1200. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +6 -0
  1201. data/third_party/abseil-cpp/absl/meta/type_traits.h +48 -373
  1202. data/third_party/abseil-cpp/absl/numeric/bits.h +4 -4
  1203. data/third_party/abseil-cpp/absl/numeric/int128.cc +20 -8
  1204. data/third_party/abseil-cpp/absl/numeric/int128.h +36 -39
  1205. data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +0 -3
  1206. data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +47 -30
  1207. data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +185 -0
  1208. data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +4 -3
  1209. data/third_party/abseil-cpp/absl/random/internal/generate_real.h +1 -1
  1210. data/third_party/abseil-cpp/absl/random/internal/platform.h +1 -1
  1211. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +4 -0
  1212. data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +1 -1
  1213. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +1 -1
  1214. data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +1 -1
  1215. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +4 -0
  1216. data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +12 -24
  1217. data/third_party/abseil-cpp/absl/status/status.cc +11 -7
  1218. data/third_party/abseil-cpp/absl/status/status.h +11 -2
  1219. data/third_party/abseil-cpp/absl/status/statusor.h +22 -8
  1220. data/third_party/abseil-cpp/absl/strings/ascii.cc +54 -6
  1221. data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -4
  1222. data/third_party/abseil-cpp/absl/strings/charconv.h +2 -2
  1223. data/third_party/abseil-cpp/absl/strings/cord.cc +1 -2
  1224. data/third_party/abseil-cpp/absl/strings/cord.h +32 -5
  1225. data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +23 -1
  1226. data/third_party/abseil-cpp/absl/strings/cord_analysis.h +18 -0
  1227. data/third_party/abseil-cpp/absl/strings/cord_buffer.h +2 -5
  1228. data/third_party/abseil-cpp/absl/strings/escaping.cc +10 -32
  1229. data/third_party/abseil-cpp/absl/strings/escaping.h +1 -1
  1230. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +2 -4
  1231. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +3 -3
  1232. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +0 -1
  1233. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +15 -13
  1234. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +13 -4
  1235. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +8 -0
  1236. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +5 -3
  1237. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +4 -7
  1238. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +8 -0
  1239. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +2 -2
  1240. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +46 -20
  1241. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +1 -34
  1242. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +2 -1
  1243. data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +23 -0
  1244. data/third_party/abseil-cpp/absl/strings/internal/escaping.h +1 -0
  1245. data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +2 -77
  1246. data/third_party/abseil-cpp/absl/strings/internal/memutil.h +4 -112
  1247. data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +1 -1
  1248. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +10 -31
  1249. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -8
  1250. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +5 -20
  1251. data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +1 -0
  1252. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +1 -1
  1253. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +9 -9
  1254. data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +56 -6
  1255. data/third_party/abseil-cpp/absl/strings/match.cc +87 -0
  1256. data/third_party/abseil-cpp/absl/strings/match.h +19 -0
  1257. data/third_party/abseil-cpp/absl/strings/numbers.cc +154 -122
  1258. data/third_party/abseil-cpp/absl/strings/numbers.h +1 -6
  1259. data/third_party/abseil-cpp/absl/strings/str_cat.cc +7 -50
  1260. data/third_party/abseil-cpp/absl/strings/str_cat.h +83 -15
  1261. data/third_party/abseil-cpp/absl/strings/str_format.h +6 -3
  1262. data/third_party/abseil-cpp/absl/strings/str_split.cc +9 -6
  1263. data/third_party/abseil-cpp/absl/strings/string_view.cc +26 -4
  1264. data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +5 -0
  1265. data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +63 -43
  1266. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +111 -0
  1267. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.h +63 -0
  1268. data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +11 -7
  1269. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +225 -0
  1270. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +122 -114
  1271. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +12 -8
  1272. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +10 -1
  1273. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +167 -0
  1274. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.h +60 -0
  1275. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +122 -0
  1276. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.h +65 -0
  1277. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +91 -0
  1278. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.h +56 -0
  1279. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +19 -113
  1280. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +42 -0
  1281. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.h +90 -0
  1282. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +151 -0
  1283. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.h +70 -0
  1284. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +407 -411
  1285. data/third_party/abseil-cpp/absl/synchronization/mutex.h +152 -118
  1286. data/third_party/abseil-cpp/absl/time/clock.cc +6 -7
  1287. data/third_party/abseil-cpp/absl/time/duration.cc +24 -26
  1288. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -0
  1289. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
  1290. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +3 -3
  1291. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +8 -6
  1292. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +6 -3
  1293. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +4 -2
  1294. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +4 -0
  1295. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +322 -295
  1296. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +8 -17
  1297. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +51 -33
  1298. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +7 -2
  1299. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +128 -2
  1300. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +1 -1
  1301. data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +5 -1
  1302. data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +34 -34
  1303. data/third_party/abseil-cpp/absl/time/time.cc +9 -2
  1304. data/third_party/abseil-cpp/absl/time/time.h +115 -15
  1305. data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -52
  1306. data/third_party/abseil-cpp/absl/types/internal/span.h +2 -2
  1307. data/third_party/abseil-cpp/absl/types/internal/variant.h +2 -2
  1308. data/third_party/abseil-cpp/absl/types/optional.h +15 -13
  1309. data/third_party/abseil-cpp/absl/types/span.h +1 -2
  1310. data/third_party/boringssl-with-bazel/err_data.c +554 -553
  1311. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +7 -3
  1312. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c +9 -8
  1313. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c +7 -7
  1314. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +6 -6
  1315. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +34 -1
  1316. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +11 -4
  1317. data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +3 -3
  1318. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +10 -6
  1319. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +7 -4
  1320. data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +9 -7
  1321. data/third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c +40 -55
  1322. data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +7 -7
  1323. data/third_party/boringssl-with-bazel/src/crypto/bio/errno.c +92 -0
  1324. data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +14 -54
  1325. data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +23 -22
  1326. data/third_party/boringssl-with-bazel/src/crypto/bio/internal.h +16 -6
  1327. data/third_party/boringssl-with-bazel/src/crypto/bio/pair.c +4 -2
  1328. data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +4 -4
  1329. data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +11 -2
  1330. data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +31 -22
  1331. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +1 -1
  1332. data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +19 -1
  1333. data/third_party/boringssl-with-bazel/src/crypto/chacha/internal.h +8 -1
  1334. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c +29 -26
  1335. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +8 -0
  1336. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +189 -13
  1337. data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +31 -192
  1338. data/third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h +3 -7
  1339. data/third_party/boringssl-with-bazel/src/crypto/conf/internal.h +8 -0
  1340. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +3 -2
  1341. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c +0 -1
  1342. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.c +0 -2
  1343. data/third_party/boringssl-with-bazel/src/crypto/{cpu_aarch64_freebsd.c → cpu_aarch64_openbsd.c} +23 -24
  1344. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.c +93 -0
  1345. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.c +1 -1
  1346. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.c +0 -1
  1347. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c +0 -2
  1348. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +55 -50
  1349. data/third_party/boringssl-with-bazel/src/crypto/{cpu_arm.c → curve25519/curve25519_64_adx.c} +4 -24
  1350. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_tables.h +2834 -7442
  1351. data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +26 -8
  1352. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c +4 -0
  1353. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c +5 -0
  1354. data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +4 -0
  1355. data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +20 -0
  1356. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +110 -72
  1357. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_derive.c +4 -3
  1358. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +42 -34
  1359. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +17 -11
  1360. data/third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c +1 -1
  1361. data/third_party/boringssl-with-bazel/src/crypto/err/err.c +23 -21
  1362. data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +35 -12
  1363. data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c +2 -4
  1364. data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c +3 -7
  1365. data/third_party/boringssl-with-bazel/src/crypto/evp/p_rsa.c +1 -1
  1366. data/third_party/boringssl-with-bazel/src/crypto/evp/pbkdf.c +3 -3
  1367. data/third_party/boringssl-with-bazel/src/crypto/evp/print.c +7 -6
  1368. data/third_party/boringssl-with-bazel/src/crypto/ex_data.c +34 -72
  1369. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +2 -1
  1370. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +12 -5
  1371. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd.c +5 -6
  1372. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +12 -6
  1373. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery.c +17 -18
  1374. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery_inv.c +51 -15
  1375. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/rsaz_exp.c +7 -7
  1376. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/delocate.h +5 -6
  1377. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/check.c +37 -8
  1378. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/dh.c +41 -19
  1379. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +9 -0
  1380. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/builtin_curves.h +277 -0
  1381. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +204 -428
  1382. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +4 -4
  1383. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_montgomery.c +31 -64
  1384. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/felem.c +17 -13
  1385. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +105 -143
  1386. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/oct.c +19 -19
  1387. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +16 -18
  1388. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-nistz.c +27 -30
  1389. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +23 -26
  1390. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256_table.h +1 -1
  1391. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/scalar.c +24 -24
  1392. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple.c +21 -37
  1393. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +31 -31
  1394. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/wnaf.c +16 -16
  1395. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdh/ecdh.c +1 -1
  1396. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +11 -5
  1397. data/third_party/boringssl-with-bazel/src/crypto/{hkdf → fipsmodule/hkdf}/hkdf.c +2 -2
  1398. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cbc.c +2 -10
  1399. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ctr.c +1 -4
  1400. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm.c +115 -133
  1401. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +12 -14
  1402. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +57 -47
  1403. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ofb.c +1 -8
  1404. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/polyval.c +27 -28
  1405. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/fork_detect.c +40 -26
  1406. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +21 -7
  1407. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +38 -19
  1408. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +2 -41
  1409. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/internal.h +76 -16
  1410. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/padding.c +5 -288
  1411. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +143 -83
  1412. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +126 -233
  1413. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +113 -24
  1414. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/service_indicator.c +4 -7
  1415. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/internal.h +8 -0
  1416. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/kdf.c +33 -0
  1417. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +169 -6
  1418. data/third_party/boringssl-with-bazel/src/crypto/internal.h +216 -87
  1419. data/third_party/boringssl-with-bazel/src/crypto/kyber/internal.h +32 -2
  1420. data/third_party/boringssl-with-bazel/src/crypto/kyber/keccak.c +11 -12
  1421. data/third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c +834 -0
  1422. data/third_party/boringssl-with-bazel/src/crypto/mem.c +7 -8
  1423. data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +25 -46
  1424. data/third_party/boringssl-with-bazel/src/crypto/obj/obj_dat.h +6 -13
  1425. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c +18 -14
  1426. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +3 -3
  1427. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/p5_pbev2.c +3 -3
  1428. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +7 -7
  1429. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +8 -5
  1430. data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +1 -0
  1431. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +7 -6
  1432. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/forkunsafe.c +6 -12
  1433. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +52 -0
  1434. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{fuchsia.c → ios.c} +8 -8
  1435. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/trusty.c +38 -0
  1436. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +41 -19
  1437. data/third_party/boringssl-with-bazel/src/crypto/{refcount_c11.c → refcount.c} +11 -17
  1438. data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/internal.h +77 -0
  1439. data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_crypt.c +568 -0
  1440. data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +152 -72
  1441. data/third_party/boringssl-with-bazel/src/crypto/thread_none.c +0 -8
  1442. data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +6 -35
  1443. data/third_party/boringssl-with-bazel/src/crypto/thread_win.c +5 -26
  1444. data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +62 -0
  1445. data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +240 -72
  1446. data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +35 -0
  1447. data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +588 -130
  1448. data/third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c +27 -18
  1449. data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +1 -1
  1450. data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +10 -20
  1451. data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +0 -3
  1452. data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +3 -2
  1453. data/third_party/boringssl-with-bazel/src/crypto/x509/name_print.c +17 -39
  1454. data/third_party/boringssl-with-bazel/src/crypto/x509/policy.c +18 -14
  1455. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +39 -48
  1456. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +1 -141
  1457. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c +1 -3
  1458. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +19 -25
  1459. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +72 -23
  1460. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +8 -4
  1461. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +8 -12
  1462. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +22 -24
  1463. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +1 -72
  1464. data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +22 -29
  1465. data/third_party/boringssl-with-bazel/src/crypto/x509/x509spki.c +1 -1
  1466. data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +9 -7
  1467. data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +1 -1
  1468. data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +7 -7
  1469. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +2 -2
  1470. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +1 -1
  1471. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +2 -3
  1472. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +33 -46
  1473. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +1 -0
  1474. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c +3 -5
  1475. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +20 -52
  1476. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +14 -26
  1477. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +11 -9
  1478. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +17 -10
  1479. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +5 -3
  1480. data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +5 -7
  1481. data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +4 -119
  1482. data/third_party/boringssl-with-bazel/src/include/openssl/asm_base.h +207 -0
  1483. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +11 -4
  1484. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +37 -112
  1485. data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +19 -13
  1486. data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +1 -4
  1487. data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +0 -2
  1488. data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +6 -0
  1489. data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +5 -1
  1490. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -1
  1491. data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +0 -21
  1492. data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +28 -11
  1493. data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +19 -6
  1494. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +14 -10
  1495. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +34 -2
  1496. data/third_party/boringssl-with-bazel/src/include/openssl/kyber.h +128 -0
  1497. data/third_party/boringssl-with-bazel/src/include/openssl/nid.h +2 -11
  1498. data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +8 -1
  1499. data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +0 -3
  1500. data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +13 -14
  1501. data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +91 -62
  1502. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +26 -19
  1503. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +275 -96
  1504. data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +242 -223
  1505. data/third_party/boringssl-with-bazel/src/include/openssl/target.h +201 -0
  1506. data/third_party/boringssl-with-bazel/src/include/openssl/thread.h +1 -25
  1507. data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +4 -0
  1508. data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +8 -0
  1509. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +760 -614
  1510. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +45 -12
  1511. data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +11 -6
  1512. data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +10 -68
  1513. data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +20 -20
  1514. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +33 -18
  1515. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
  1516. data/third_party/boringssl-with-bazel/src/ssl/internal.h +86 -46
  1517. data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +37 -18
  1518. data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +8 -4
  1519. data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +209 -209
  1520. data/third_party/boringssl-with-bazel/src/ssl/ssl_file.cc +6 -6
  1521. data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +76 -118
  1522. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +209 -33
  1523. data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +17 -4
  1524. data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +19 -21
  1525. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +27 -19
  1526. data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +2 -1
  1527. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +2 -3
  1528. data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +5 -21
  1529. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +5 -2
  1530. data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64_adx.h +691 -0
  1531. data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64_msvc.h +1281 -0
  1532. data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_64_msvc.h +2002 -0
  1533. data/third_party/cares/cares/include/ares.h +23 -1
  1534. data/third_party/cares/cares/{src/lib → include}/ares_nameser.h +9 -7
  1535. data/third_party/cares/cares/include/ares_rules.h +2 -2
  1536. data/third_party/cares/cares/include/ares_version.h +3 -3
  1537. data/third_party/cares/cares/src/lib/ares__addrinfo2hostent.c +266 -0
  1538. data/third_party/cares/cares/src/lib/ares__addrinfo_localhost.c +240 -0
  1539. data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +49 -80
  1540. data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +37 -43
  1541. data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +12 -4
  1542. data/third_party/cares/cares/src/lib/ares_data.c +16 -0
  1543. data/third_party/cares/cares/src/lib/ares_data.h +7 -0
  1544. data/third_party/cares/cares/src/lib/ares_destroy.c +8 -0
  1545. data/third_party/cares/cares/src/lib/ares_expand_name.c +17 -6
  1546. data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +1 -0
  1547. data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +156 -78
  1548. data/third_party/cares/cares/src/lib/ares_gethostbyname.c +130 -326
  1549. data/third_party/cares/cares/src/lib/ares_init.c +97 -485
  1550. data/third_party/cares/cares/src/lib/ares_library_init.c +2 -89
  1551. data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +23 -142
  1552. data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +22 -142
  1553. data/third_party/cares/cares/src/lib/ares_parse_uri_reply.c +184 -0
  1554. data/third_party/cares/cares/src/lib/ares_private.h +30 -16
  1555. data/third_party/cares/cares/src/lib/ares_process.c +55 -16
  1556. data/third_party/cares/cares/src/lib/ares_query.c +1 -35
  1557. data/third_party/cares/cares/src/lib/ares_rand.c +279 -0
  1558. data/third_party/cares/cares/src/lib/ares_send.c +5 -7
  1559. data/third_party/cares/cares/src/lib/ares_strdup.c +12 -19
  1560. data/third_party/cares/cares/src/lib/ares_strsplit.c +44 -128
  1561. data/third_party/cares/cares/src/lib/ares_strsplit.h +9 -10
  1562. data/third_party/cares/cares/src/lib/inet_net_pton.c +78 -116
  1563. data/third_party/cares/cares/src/tools/ares_getopt.h +53 -0
  1564. data/third_party/upb/upb/{table_internal.h → alloc.h} +6 -6
  1565. data/third_party/upb/upb/arena.h +4 -193
  1566. data/third_party/upb/upb/array.h +4 -51
  1567. data/third_party/upb/upb/base/descriptor_constants.h +104 -0
  1568. data/third_party/upb/upb/base/log2.h +57 -0
  1569. data/third_party/upb/upb/{status.c → base/status.c} +2 -7
  1570. data/third_party/upb/upb/base/status.h +66 -0
  1571. data/third_party/upb/upb/base/string_view.h +75 -0
  1572. data/third_party/upb/upb/{array.c → collections/array.c} +73 -36
  1573. data/third_party/upb/upb/collections/array.h +91 -0
  1574. data/third_party/upb/upb/collections/array_internal.h +135 -0
  1575. data/third_party/upb/upb/{map.c → collections/map.c} +60 -26
  1576. data/third_party/upb/upb/collections/map.h +140 -0
  1577. data/third_party/upb/upb/collections/map_gencode_util.h +78 -0
  1578. data/third_party/upb/upb/collections/map_internal.h +170 -0
  1579. data/third_party/upb/upb/collections/map_sorter.c +166 -0
  1580. data/third_party/upb/upb/collections/map_sorter_internal.h +109 -0
  1581. data/third_party/upb/upb/{message_value.h → collections/message_value.h} +19 -13
  1582. data/third_party/upb/upb/decode.h +3 -62
  1583. data/third_party/upb/upb/def.h +4 -384
  1584. data/third_party/upb/upb/def.hpp +3 -411
  1585. data/third_party/upb/upb/encode.h +3 -48
  1586. data/third_party/upb/upb/extension_registry.h +3 -52
  1587. data/third_party/upb/upb/generated_code_support.h +54 -0
  1588. data/third_party/upb/upb/{table.c → hash/common.c} +55 -108
  1589. data/third_party/upb/upb/hash/common.h +200 -0
  1590. data/third_party/upb/upb/hash/int_table.h +102 -0
  1591. data/third_party/upb/upb/hash/str_table.h +162 -0
  1592. data/third_party/upb/upb/{json_decode.c → json/decode.c} +63 -98
  1593. data/third_party/upb/upb/{json_decode.h → json/decode.h} +8 -3
  1594. data/third_party/upb/upb/{json_encode.c → json/encode.c} +69 -45
  1595. data/third_party/upb/upb/{json_encode.h → json/encode.h} +8 -3
  1596. data/third_party/upb/upb/lex/atoi.c +68 -0
  1597. data/third_party/upb/upb/lex/atoi.h +53 -0
  1598. data/third_party/upb/upb/{upb.c → lex/round_trip.c} +2 -11
  1599. data/third_party/upb/upb/{internal/upb.h → lex/round_trip.h} +17 -30
  1600. data/third_party/upb/upb/lex/strtod.c +97 -0
  1601. data/third_party/upb/upb/lex/strtod.h +46 -0
  1602. data/third_party/upb/upb/lex/unicode.c +57 -0
  1603. data/third_party/upb/upb/lex/unicode.h +77 -0
  1604. data/third_party/upb/upb/map.h +4 -85
  1605. data/third_party/upb/upb/mem/alloc.c +47 -0
  1606. data/third_party/upb/upb/mem/alloc.h +98 -0
  1607. data/third_party/upb/upb/mem/arena.c +367 -0
  1608. data/third_party/upb/upb/mem/arena.h +160 -0
  1609. data/third_party/upb/upb/mem/arena_internal.h +114 -0
  1610. data/third_party/upb/upb/message/accessors.c +92 -0
  1611. data/third_party/upb/upb/message/accessors.h +400 -0
  1612. data/third_party/upb/upb/message/accessors_internal.h +391 -0
  1613. data/third_party/upb/upb/message/extension_internal.h +83 -0
  1614. data/third_party/upb/upb/message/internal/map_entry.h +64 -0
  1615. data/third_party/upb/upb/message/internal.h +131 -0
  1616. data/third_party/upb/upb/message/message.c +174 -0
  1617. data/third_party/upb/upb/message/message.h +69 -0
  1618. data/third_party/upb/upb/message/tagged_ptr.h +89 -0
  1619. data/third_party/upb/upb/mini_descriptor/build_enum.c +150 -0
  1620. data/third_party/upb/upb/mini_descriptor/build_enum.h +63 -0
  1621. data/third_party/upb/upb/mini_descriptor/decode.c +875 -0
  1622. data/third_party/upb/upb/mini_descriptor/decode.h +140 -0
  1623. data/third_party/upb/upb/mini_descriptor/internal/base92.c +46 -0
  1624. data/third_party/upb/upb/mini_descriptor/internal/base92.h +81 -0
  1625. data/third_party/upb/upb/mini_descriptor/internal/decoder.h +73 -0
  1626. data/third_party/upb/upb/mini_descriptor/internal/encode.c +326 -0
  1627. data/third_party/upb/upb/mini_descriptor/internal/encode.h +110 -0
  1628. data/third_party/upb/upb/{mini_table.hpp → mini_descriptor/internal/encode.hpp} +32 -8
  1629. data/third_party/upb/upb/mini_descriptor/internal/modifiers.h +50 -0
  1630. data/third_party/upb/upb/mini_descriptor/internal/wire_constants.h +91 -0
  1631. data/third_party/upb/upb/mini_descriptor/link.c +142 -0
  1632. data/third_party/upb/upb/mini_descriptor/link.h +104 -0
  1633. data/third_party/upb/upb/mini_table/enum.h +50 -0
  1634. data/third_party/upb/upb/mini_table/extension.h +40 -0
  1635. data/third_party/upb/upb/{extension_registry.c → mini_table/extension_registry.c} +27 -24
  1636. data/third_party/upb/upb/mini_table/extension_registry.h +105 -0
  1637. data/third_party/upb/upb/mini_table/field.h +118 -0
  1638. data/third_party/upb/upb/{collections.h → mini_table/file.h} +6 -7
  1639. data/third_party/upb/upb/mini_table/internal/enum.h +76 -0
  1640. data/third_party/upb/upb/mini_table/internal/extension.h +47 -0
  1641. data/third_party/upb/upb/mini_table/internal/field.h +136 -0
  1642. data/third_party/upb/upb/mini_table/internal/file.h +49 -0
  1643. data/third_party/upb/upb/mini_table/internal/message.c +39 -0
  1644. data/third_party/upb/upb/mini_table/internal/message.h +113 -0
  1645. data/third_party/upb/upb/mini_table/internal/sub.h +39 -0
  1646. data/third_party/upb/upb/mini_table/message.c +97 -0
  1647. data/third_party/upb/upb/mini_table/message.h +105 -0
  1648. data/third_party/upb/upb/mini_table/sub.h +35 -0
  1649. data/third_party/upb/upb/msg.h +3 -38
  1650. data/third_party/upb/upb/port/atomic.h +101 -0
  1651. data/third_party/upb/upb/{port_def.inc → port/def.inc} +94 -27
  1652. data/third_party/upb/upb/{port_undef.inc → port/undef.inc} +13 -3
  1653. data/third_party/upb/upb/{internal → port}/vsnprintf_compat.h +5 -7
  1654. data/third_party/upb/upb/reflection/common.h +67 -0
  1655. data/third_party/upb/upb/reflection/def.h +42 -0
  1656. data/third_party/upb/upb/reflection/def.hpp +622 -0
  1657. data/third_party/upb/upb/reflection/def_builder.c +357 -0
  1658. data/third_party/upb/upb/reflection/def_builder_internal.h +157 -0
  1659. data/third_party/upb/upb/reflection/def_pool.c +462 -0
  1660. data/third_party/upb/upb/reflection/def_pool.h +108 -0
  1661. data/third_party/upb/upb/reflection/def_pool_internal.h +77 -0
  1662. data/third_party/upb/upb/reflection/def_type.c +50 -0
  1663. data/third_party/upb/upb/reflection/def_type.h +81 -0
  1664. data/third_party/upb/upb/reflection/desc_state.c +53 -0
  1665. data/third_party/upb/upb/reflection/desc_state_internal.h +64 -0
  1666. data/third_party/upb/upb/reflection/enum_def.c +310 -0
  1667. data/third_party/upb/upb/reflection/enum_def.h +80 -0
  1668. data/third_party/upb/upb/reflection/enum_def_internal.h +56 -0
  1669. data/third_party/upb/upb/reflection/enum_reserved_range.c +84 -0
  1670. data/third_party/upb/upb/reflection/enum_reserved_range.h +51 -0
  1671. data/third_party/upb/upb/reflection/enum_reserved_range_internal.h +55 -0
  1672. data/third_party/upb/upb/reflection/enum_value_def.c +144 -0
  1673. data/third_party/upb/upb/reflection/enum_value_def.h +57 -0
  1674. data/third_party/upb/upb/reflection/enum_value_def_internal.h +57 -0
  1675. data/third_party/upb/upb/reflection/extension_range.c +93 -0
  1676. data/third_party/upb/upb/reflection/extension_range.h +55 -0
  1677. data/third_party/upb/upb/reflection/extension_range_internal.h +54 -0
  1678. data/third_party/upb/upb/reflection/field_def.c +931 -0
  1679. data/third_party/upb/upb/reflection/field_def.h +91 -0
  1680. data/third_party/upb/upb/reflection/field_def_internal.h +76 -0
  1681. data/third_party/upb/upb/reflection/file_def.c +370 -0
  1682. data/third_party/upb/upb/reflection/file_def.h +77 -0
  1683. data/third_party/upb/upb/reflection/file_def_internal.h +57 -0
  1684. data/third_party/upb/upb/reflection/message.c +233 -0
  1685. data/third_party/upb/upb/reflection/message.h +102 -0
  1686. data/third_party/upb/upb/reflection/message.hpp +37 -0
  1687. data/third_party/upb/upb/reflection/message_def.c +720 -0
  1688. data/third_party/upb/upb/reflection/message_def.h +174 -0
  1689. data/third_party/upb/upb/reflection/message_def_internal.h +63 -0
  1690. data/third_party/upb/upb/reflection/message_reserved_range.c +81 -0
  1691. data/third_party/upb/upb/reflection/message_reserved_range.h +51 -0
  1692. data/third_party/upb/upb/reflection/message_reserved_range_internal.h +55 -0
  1693. data/third_party/upb/upb/reflection/method_def.c +124 -0
  1694. data/third_party/upb/upb/reflection/method_def.h +59 -0
  1695. data/third_party/upb/upb/reflection/method_def_internal.h +53 -0
  1696. data/third_party/upb/upb/reflection/oneof_def.c +226 -0
  1697. data/third_party/upb/upb/reflection/oneof_def.h +66 -0
  1698. data/third_party/upb/upb/reflection/oneof_def_internal.h +57 -0
  1699. data/third_party/upb/upb/reflection/service_def.c +128 -0
  1700. data/third_party/upb/upb/reflection/service_def.h +60 -0
  1701. data/third_party/upb/upb/reflection/service_def_internal.h +53 -0
  1702. data/third_party/upb/upb/reflection.h +4 -78
  1703. data/third_party/upb/upb/reflection.hpp +3 -7
  1704. data/third_party/upb/upb/status.h +4 -34
  1705. data/third_party/upb/upb/string_view.h +36 -0
  1706. data/third_party/upb/upb/{text_encode.c → text/encode.c} +74 -70
  1707. data/third_party/upb/upb/text/encode.h +69 -0
  1708. data/third_party/upb/upb/text_encode.h +4 -32
  1709. data/third_party/upb/upb/upb.h +6 -151
  1710. data/third_party/upb/upb/upb.hpp +10 -18
  1711. data/third_party/upb/upb/wire/common.h +44 -0
  1712. data/third_party/upb/upb/wire/common_internal.h +50 -0
  1713. data/third_party/upb/upb/wire/decode.c +1382 -0
  1714. data/third_party/upb/upb/wire/decode.h +148 -0
  1715. data/third_party/upb/upb/{decode_fast.c → wire/decode_fast.c} +184 -225
  1716. data/third_party/upb/upb/{decode_fast.h → wire/decode_fast.h} +21 -7
  1717. data/third_party/upb/upb/{internal/decode.h → wire/decode_internal.h} +44 -92
  1718. data/third_party/upb/upb/{encode.c → wire/encode.c} +134 -105
  1719. data/third_party/upb/upb/wire/encode.h +92 -0
  1720. data/third_party/upb/upb/wire/eps_copy_input_stream.c +39 -0
  1721. data/third_party/upb/upb/wire/eps_copy_input_stream.h +425 -0
  1722. data/third_party/upb/upb/wire/reader.c +67 -0
  1723. data/third_party/upb/upb/wire/reader.h +227 -0
  1724. data/third_party/upb/upb/wire/swap_internal.h +63 -0
  1725. data/third_party/upb/upb/wire/types.h +41 -0
  1726. data/third_party/{upb/third_party/utf8_range → utf8_range}/range2-neon.c +1 -1
  1727. data/third_party/{upb/third_party/utf8_range → utf8_range}/utf8_range.h +12 -0
  1728. metadata +286 -87
  1729. data/src/core/ext/filters/client_channel/health/health_check_client.cc +0 -175
  1730. data/src/core/ext/filters/client_channel/health/health_check_client.h +0 -43
  1731. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.cc +0 -42
  1732. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +0 -64
  1733. data/src/core/ext/transport/chttp2/transport/context_list.cc +0 -71
  1734. data/src/core/ext/transport/chttp2/transport/context_list.h +0 -54
  1735. data/src/core/ext/transport/chttp2/transport/stream_map.cc +0 -177
  1736. data/src/core/ext/transport/chttp2/transport/stream_map.h +0 -68
  1737. data/src/core/lib/event_engine/thread_pool.cc +0 -253
  1738. data/src/core/lib/event_engine/thread_pool.h +0 -141
  1739. data/src/core/lib/promise/detail/basic_join.h +0 -197
  1740. data/src/core/lib/promise/detail/switch.h +0 -1455
  1741. data/src/core/lib/promise/try_join.h +0 -82
  1742. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -403
  1743. data/third_party/boringssl-with-bazel/src/crypto/refcount_lock.c +0 -52
  1744. data/third_party/cares/cares/src/lib/ares_library_init.h +0 -43
  1745. data/third_party/re2/util/benchmark.h +0 -156
  1746. data/third_party/re2/util/flags.h +0 -26
  1747. data/third_party/re2/util/malloc_counter.h +0 -19
  1748. data/third_party/re2/util/pcre.cc +0 -1025
  1749. data/third_party/re2/util/pcre.h +0 -681
  1750. data/third_party/re2/util/test.h +0 -50
  1751. data/third_party/upb/upb/arena.c +0 -277
  1752. data/third_party/upb/upb/decode.c +0 -1221
  1753. data/third_party/upb/upb/def.c +0 -3269
  1754. data/third_party/upb/upb/internal/table.h +0 -385
  1755. data/third_party/upb/upb/mini_table.c +0 -1147
  1756. data/third_party/upb/upb/mini_table.h +0 -189
  1757. data/third_party/upb/upb/msg.c +0 -368
  1758. data/third_party/upb/upb/msg_internal.h +0 -837
  1759. data/third_party/upb/upb/reflection.c +0 -323
  1760. data/third_party/zlib/gzclose.c +0 -25
  1761. data/third_party/zlib/gzlib.c +0 -639
  1762. data/third_party/zlib/gzread.c +0 -650
  1763. data/third_party/zlib/gzwrite.c +0 -677
  1764. /data/third_party/{upb/third_party/utf8_range → utf8_range}/naive.c +0 -0
  1765. /data/third_party/{upb/third_party/utf8_range → utf8_range}/range2-sse.c +0 -0
@@ -35,10 +35,9 @@
35
35
 
36
36
  #include <algorithm>
37
37
  #include <atomic>
38
- #include <cinttypes>
39
38
  #include <cstddef>
39
+ #include <cstdlib>
40
40
  #include <cstring>
41
- #include <iterator>
42
41
  #include <thread> // NOLINT(build/c++11)
43
42
 
44
43
  #include "absl/base/attributes.h"
@@ -55,7 +54,6 @@
55
54
  #include "absl/base/internal/thread_identity.h"
56
55
  #include "absl/base/internal/tsan_mutex_interface.h"
57
56
  #include "absl/base/optimization.h"
58
- #include "absl/base/port.h"
59
57
  #include "absl/debugging/stacktrace.h"
60
58
  #include "absl/debugging/symbolize.h"
61
59
  #include "absl/synchronization/internal/graphcycles.h"
@@ -63,6 +61,7 @@
63
61
  #include "absl/time/time.h"
64
62
 
65
63
  using absl::base_internal::CurrentThreadIdentityIfPresent;
64
+ using absl::base_internal::CycleClock;
66
65
  using absl::base_internal::PerThreadSynch;
67
66
  using absl::base_internal::SchedulingGuard;
68
67
  using absl::base_internal::ThreadIdentity;
@@ -98,18 +97,15 @@ ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES
98
97
  absl::base_internal::AtomicHook<void (*)(int64_t wait_cycles)>
99
98
  submit_profile_data;
100
99
  ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES absl::base_internal::AtomicHook<void (*)(
101
- const char *msg, const void *obj, int64_t wait_cycles)>
100
+ const char* msg, const void* obj, int64_t wait_cycles)>
102
101
  mutex_tracer;
103
102
  ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES
104
- absl::base_internal::AtomicHook<void (*)(const char *msg, const void *cv)>
105
- cond_var_tracer;
106
- ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES absl::base_internal::AtomicHook<
107
- bool (*)(const void *pc, char *out, int out_size)>
108
- symbolizer(absl::Symbolize);
103
+ absl::base_internal::AtomicHook<void (*)(const char* msg, const void* cv)>
104
+ cond_var_tracer;
109
105
 
110
106
  } // namespace
111
107
 
112
- static inline bool EvalConditionAnnotated(const Condition *cond, Mutex *mu,
108
+ static inline bool EvalConditionAnnotated(const Condition* cond, Mutex* mu,
113
109
  bool locking, bool trylock,
114
110
  bool read_lock);
115
111
 
@@ -117,19 +113,15 @@ void RegisterMutexProfiler(void (*fn)(int64_t wait_cycles)) {
117
113
  submit_profile_data.Store(fn);
118
114
  }
119
115
 
120
- void RegisterMutexTracer(void (*fn)(const char *msg, const void *obj,
116
+ void RegisterMutexTracer(void (*fn)(const char* msg, const void* obj,
121
117
  int64_t wait_cycles)) {
122
118
  mutex_tracer.Store(fn);
123
119
  }
124
120
 
125
- void RegisterCondVarTracer(void (*fn)(const char *msg, const void *cv)) {
121
+ void RegisterCondVarTracer(void (*fn)(const char* msg, const void* cv)) {
126
122
  cond_var_tracer.Store(fn);
127
123
  }
128
124
 
129
- void RegisterSymbolizer(bool (*fn)(const void *pc, char *out, int out_size)) {
130
- symbolizer.Store(fn);
131
- }
132
-
133
125
  namespace {
134
126
  // Represents the strategy for spin and yield.
135
127
  // See the comment in GetMutexGlobals() for more information.
@@ -148,25 +140,24 @@ absl::Duration MeasureTimeToYield() {
148
140
  return absl::Now() - before;
149
141
  }
150
142
 
151
- const MutexGlobals &GetMutexGlobals() {
143
+ const MutexGlobals& GetMutexGlobals() {
152
144
  ABSL_CONST_INIT static MutexGlobals data;
153
145
  absl::base_internal::LowLevelCallOnce(&data.once, [&]() {
154
- const int num_cpus = absl::base_internal::NumCPUs();
155
- data.spinloop_iterations = num_cpus > 1 ? 1500 : 0;
156
- // If this a uniprocessor, only yield/sleep.
157
- // Real-time threads are often unable to yield, so the sleep time needs
158
- // to be long enough to keep the calling thread asleep until scheduling
159
- // happens.
160
- // If this is multiprocessor, allow spinning. If the mode is
161
- // aggressive then spin many times before yielding. If the mode is
162
- // gentle then spin only a few times before yielding. Aggressive spinning
163
- // is used to ensure that an Unlock() call, which must get the spin lock
164
- // for any thread to make progress gets it without undue delay.
165
- if (num_cpus > 1) {
146
+ if (absl::base_internal::NumCPUs() > 1) {
147
+ // If this is multiprocessor, allow spinning. If the mode is
148
+ // aggressive then spin many times before yielding. If the mode is
149
+ // gentle then spin only a few times before yielding. Aggressive spinning
150
+ // is used to ensure that an Unlock() call, which must get the spin lock
151
+ // for any thread to make progress gets it without undue delay.
152
+ data.spinloop_iterations = 1500;
166
153
  data.mutex_sleep_spins[AGGRESSIVE] = 5000;
167
154
  data.mutex_sleep_spins[GENTLE] = 250;
168
155
  data.mutex_sleep_time = absl::Microseconds(10);
169
156
  } else {
157
+ // If this a uniprocessor, only yield/sleep. Real-time threads are often
158
+ // unable to yield, so the sleep time needs to be long enough to keep
159
+ // the calling thread asleep until scheduling happens.
160
+ data.spinloop_iterations = 0;
170
161
  data.mutex_sleep_spins[AGGRESSIVE] = 0;
171
162
  data.mutex_sleep_spins[GENTLE] = 0;
172
163
  data.mutex_sleep_time = MeasureTimeToYield() * 5;
@@ -219,8 +210,7 @@ static void AtomicSetBits(std::atomic<intptr_t>* pv, intptr_t bits,
219
210
  v = pv->load(std::memory_order_relaxed);
220
211
  } while ((v & bits) != bits &&
221
212
  ((v & wait_until_clear) != 0 ||
222
- !pv->compare_exchange_weak(v, v | bits,
223
- std::memory_order_release,
213
+ !pv->compare_exchange_weak(v, v | bits, std::memory_order_release,
224
214
  std::memory_order_relaxed)));
225
215
  }
226
216
 
@@ -235,8 +225,7 @@ static void AtomicClearBits(std::atomic<intptr_t>* pv, intptr_t bits,
235
225
  v = pv->load(std::memory_order_relaxed);
236
226
  } while ((v & bits) != 0 &&
237
227
  ((v & wait_until_clear) != 0 ||
238
- !pv->compare_exchange_weak(v, v & ~bits,
239
- std::memory_order_release,
228
+ !pv->compare_exchange_weak(v, v & ~bits, std::memory_order_release,
240
229
  std::memory_order_relaxed)));
241
230
  }
242
231
 
@@ -247,7 +236,7 @@ ABSL_CONST_INIT static absl::base_internal::SpinLock deadlock_graph_mu(
247
236
  absl::kConstInit, base_internal::SCHEDULE_KERNEL_ONLY);
248
237
 
249
238
  // Graph used to detect deadlocks.
250
- ABSL_CONST_INIT static GraphCycles *deadlock_graph
239
+ ABSL_CONST_INIT static GraphCycles* deadlock_graph
251
240
  ABSL_GUARDED_BY(deadlock_graph_mu) ABSL_PT_GUARDED_BY(deadlock_graph_mu);
252
241
 
253
242
  //------------------------------------------------------------------
@@ -291,7 +280,7 @@ enum { // Event flags
291
280
  // Properties of the events.
292
281
  static const struct {
293
282
  int flags;
294
- const char *msg;
283
+ const char* msg;
295
284
  } event_properties[] = {
296
285
  {SYNCH_F_LCK_W | SYNCH_F_TRY, "TryLock succeeded "},
297
286
  {0, "TryLock failed "},
@@ -316,12 +305,12 @@ ABSL_CONST_INIT static absl::base_internal::SpinLock synch_event_mu(
316
305
  // Can't be too small, as it's used for deadlock detection information.
317
306
  static constexpr uint32_t kNSynchEvent = 1031;
318
307
 
319
- static struct SynchEvent { // this is a trivial hash table for the events
308
+ static struct SynchEvent { // this is a trivial hash table for the events
320
309
  // struct is freed when refcount reaches 0
321
310
  int refcount ABSL_GUARDED_BY(synch_event_mu);
322
311
 
323
312
  // buckets have linear, 0-terminated chains
324
- SynchEvent *next ABSL_GUARDED_BY(synch_event_mu);
313
+ SynchEvent* next ABSL_GUARDED_BY(synch_event_mu);
325
314
 
326
315
  // Constant after initialization
327
316
  uintptr_t masked_addr; // object at this address is called "name"
@@ -329,13 +318,13 @@ static struct SynchEvent { // this is a trivial hash table for the events
329
318
  // No explicit synchronization used. Instead we assume that the
330
319
  // client who enables/disables invariants/logging on a Mutex does so
331
320
  // while the Mutex is not being concurrently accessed by others.
332
- void (*invariant)(void *arg); // called on each event
333
- void *arg; // first arg to (*invariant)()
334
- bool log; // logging turned on
321
+ void (*invariant)(void* arg); // called on each event
322
+ void* arg; // first arg to (*invariant)()
323
+ bool log; // logging turned on
335
324
 
336
325
  // Constant after initialization
337
- char name[1]; // actually longer---NUL-terminated string
338
- } * synch_event[kNSynchEvent] ABSL_GUARDED_BY(synch_event_mu);
326
+ char name[1]; // actually longer---NUL-terminated string
327
+ }* synch_event[kNSynchEvent] ABSL_GUARDED_BY(synch_event_mu);
339
328
 
340
329
  // Ensure that the object at "addr" has a SynchEvent struct associated with it,
341
330
  // set "bits" in the word there (waiting until lockbit is clear before doing
@@ -344,11 +333,11 @@ static struct SynchEvent { // this is a trivial hash table for the events
344
333
  // the string name is copied into it.
345
334
  // When used with a mutex, the caller should also ensure that kMuEvent
346
335
  // is set in the mutex word, and similarly for condition variables and kCVEvent.
347
- static SynchEvent *EnsureSynchEvent(std::atomic<intptr_t> *addr,
348
- const char *name, intptr_t bits,
336
+ static SynchEvent* EnsureSynchEvent(std::atomic<intptr_t>* addr,
337
+ const char* name, intptr_t bits,
349
338
  intptr_t lockbit) {
350
339
  uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
351
- SynchEvent *e;
340
+ SynchEvent* e;
352
341
  // first look for existing SynchEvent struct..
353
342
  synch_event_mu.Lock();
354
343
  for (e = synch_event[h];
@@ -360,9 +349,9 @@ static SynchEvent *EnsureSynchEvent(std::atomic<intptr_t> *addr,
360
349
  name = "";
361
350
  }
362
351
  size_t l = strlen(name);
363
- e = reinterpret_cast<SynchEvent *>(
352
+ e = reinterpret_cast<SynchEvent*>(
364
353
  base_internal::LowLevelAlloc::Alloc(sizeof(*e) + l));
365
- e->refcount = 2; // one for return value, one for linked list
354
+ e->refcount = 2; // one for return value, one for linked list
366
355
  e->masked_addr = base_internal::HidePtr(addr);
367
356
  e->invariant = nullptr;
368
357
  e->arg = nullptr;
@@ -372,19 +361,19 @@ static SynchEvent *EnsureSynchEvent(std::atomic<intptr_t> *addr,
372
361
  AtomicSetBits(addr, bits, lockbit);
373
362
  synch_event[h] = e;
374
363
  } else {
375
- e->refcount++; // for return value
364
+ e->refcount++; // for return value
376
365
  }
377
366
  synch_event_mu.Unlock();
378
367
  return e;
379
368
  }
380
369
 
381
370
  // Deallocate the SynchEvent *e, whose refcount has fallen to zero.
382
- static void DeleteSynchEvent(SynchEvent *e) {
371
+ static void DeleteSynchEvent(SynchEvent* e) {
383
372
  base_internal::LowLevelAlloc::Free(e);
384
373
  }
385
374
 
386
375
  // Decrement the reference count of *e, or do nothing if e==null.
387
- static void UnrefSynchEvent(SynchEvent *e) {
376
+ static void UnrefSynchEvent(SynchEvent* e) {
388
377
  if (e != nullptr) {
389
378
  synch_event_mu.Lock();
390
379
  bool del = (--(e->refcount) == 0);
@@ -398,11 +387,11 @@ static void UnrefSynchEvent(SynchEvent *e) {
398
387
  // Forget the mapping from the object (Mutex or CondVar) at address addr
399
388
  // to SynchEvent object, and clear "bits" in its word (waiting until lockbit
400
389
  // is clear before doing so).
401
- static void ForgetSynchEvent(std::atomic<intptr_t> *addr, intptr_t bits,
390
+ static void ForgetSynchEvent(std::atomic<intptr_t>* addr, intptr_t bits,
402
391
  intptr_t lockbit) {
403
392
  uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
404
- SynchEvent **pe;
405
- SynchEvent *e;
393
+ SynchEvent** pe;
394
+ SynchEvent* e;
406
395
  synch_event_mu.Lock();
407
396
  for (pe = &synch_event[h];
408
397
  (e = *pe) != nullptr && e->masked_addr != base_internal::HidePtr(addr);
@@ -423,9 +412,9 @@ static void ForgetSynchEvent(std::atomic<intptr_t> *addr, intptr_t bits,
423
412
  // Return a refcounted reference to the SynchEvent of the object at address
424
413
  // "addr", if any. The pointer returned is valid until the UnrefSynchEvent() is
425
414
  // called.
426
- static SynchEvent *GetSynchEvent(const void *addr) {
415
+ static SynchEvent* GetSynchEvent(const void* addr) {
427
416
  uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
428
- SynchEvent *e;
417
+ SynchEvent* e;
429
418
  synch_event_mu.Lock();
430
419
  for (e = synch_event[h];
431
420
  e != nullptr && e->masked_addr != base_internal::HidePtr(addr);
@@ -440,17 +429,17 @@ static SynchEvent *GetSynchEvent(const void *addr) {
440
429
 
441
430
  // Called when an event "ev" occurs on a Mutex of CondVar "obj"
442
431
  // if event recording is on
443
- static void PostSynchEvent(void *obj, int ev) {
444
- SynchEvent *e = GetSynchEvent(obj);
432
+ static void PostSynchEvent(void* obj, int ev) {
433
+ SynchEvent* e = GetSynchEvent(obj);
445
434
  // logging is on if event recording is on and either there's no event struct,
446
435
  // or it explicitly says to log
447
436
  if (e == nullptr || e->log) {
448
- void *pcs[40];
437
+ void* pcs[40];
449
438
  int n = absl::GetStackTrace(pcs, ABSL_ARRAYSIZE(pcs), 1);
450
439
  // A buffer with enough space for the ASCII for all the PCs, even on a
451
440
  // 64-bit machine.
452
441
  char buffer[ABSL_ARRAYSIZE(pcs) * 24];
453
- int pos = snprintf(buffer, sizeof (buffer), " @");
442
+ int pos = snprintf(buffer, sizeof(buffer), " @");
454
443
  for (int i = 0; i != n; i++) {
455
444
  int b = snprintf(&buffer[pos], sizeof(buffer) - static_cast<size_t>(pos),
456
445
  " %p", pcs[i]);
@@ -472,13 +461,13 @@ static void PostSynchEvent(void *obj, int ev) {
472
461
  // get false positive race reports later.
473
462
  // Reuse EvalConditionAnnotated to properly call into user code.
474
463
  struct local {
475
- static bool pred(SynchEvent *ev) {
464
+ static bool pred(SynchEvent* ev) {
476
465
  (*ev->invariant)(ev->arg);
477
466
  return false;
478
467
  }
479
468
  };
480
469
  Condition cond(&local::pred, e);
481
- Mutex *mu = static_cast<Mutex *>(obj);
470
+ Mutex* mu = static_cast<Mutex*>(obj);
482
471
  const bool locking = (flags & SYNCH_F_UNLOCK) == 0;
483
472
  const bool trylock = (flags & SYNCH_F_TRY) != 0;
484
473
  const bool read_lock = (flags & SYNCH_F_R) != 0;
@@ -504,32 +493,32 @@ static void PostSynchEvent(void *obj, int ev) {
504
493
  // PerThreadSynch struct points at the most recent SynchWaitParams struct when
505
494
  // the thread is on a Mutex's waiter queue.
506
495
  struct SynchWaitParams {
507
- SynchWaitParams(Mutex::MuHow how_arg, const Condition *cond_arg,
508
- KernelTimeout timeout_arg, Mutex *cvmu_arg,
509
- PerThreadSynch *thread_arg,
510
- std::atomic<intptr_t> *cv_word_arg)
496
+ SynchWaitParams(Mutex::MuHow how_arg, const Condition* cond_arg,
497
+ KernelTimeout timeout_arg, Mutex* cvmu_arg,
498
+ PerThreadSynch* thread_arg,
499
+ std::atomic<intptr_t>* cv_word_arg)
511
500
  : how(how_arg),
512
501
  cond(cond_arg),
513
502
  timeout(timeout_arg),
514
503
  cvmu(cvmu_arg),
515
504
  thread(thread_arg),
516
505
  cv_word(cv_word_arg),
517
- contention_start_cycles(base_internal::CycleClock::Now()),
506
+ contention_start_cycles(CycleClock::Now()),
518
507
  should_submit_contention_data(false) {}
519
508
 
520
509
  const Mutex::MuHow how; // How this thread needs to wait.
521
- const Condition *cond; // The condition that this thread is waiting for.
522
- // In Mutex, this field is set to zero if a timeout
523
- // expires.
510
+ const Condition* cond; // The condition that this thread is waiting for.
511
+ // In Mutex, this field is set to zero if a timeout
512
+ // expires.
524
513
  KernelTimeout timeout; // timeout expiry---absolute time
525
514
  // In Mutex, this field is set to zero if a timeout
526
515
  // expires.
527
- Mutex *const cvmu; // used for transfer from cond var to mutex
528
- PerThreadSynch *const thread; // thread that is waiting
516
+ Mutex* const cvmu; // used for transfer from cond var to mutex
517
+ PerThreadSynch* const thread; // thread that is waiting
529
518
 
530
519
  // If not null, thread should be enqueued on the CondVar whose state
531
520
  // word is cv_word instead of queueing normally on the Mutex.
532
- std::atomic<intptr_t> *cv_word;
521
+ std::atomic<intptr_t>* cv_word;
533
522
 
534
523
  int64_t contention_start_cycles; // Time (in cycles) when this thread started
535
524
  // to contend for the mutex.
@@ -537,12 +526,12 @@ struct SynchWaitParams {
537
526
  };
538
527
 
539
528
  struct SynchLocksHeld {
540
- int n; // number of valid entries in locks[]
541
- bool overflow; // true iff we overflowed the array at some point
529
+ int n; // number of valid entries in locks[]
530
+ bool overflow; // true iff we overflowed the array at some point
542
531
  struct {
543
- Mutex *mu; // lock acquired
544
- int32_t count; // times acquired
545
- GraphId id; // deadlock_graph id of acquired lock
532
+ Mutex* mu; // lock acquired
533
+ int32_t count; // times acquired
534
+ GraphId id; // deadlock_graph id of acquired lock
546
535
  } locks[40];
547
536
  // If a thread overfills the array during deadlock detection, we
548
537
  // continue, discarding information as needed. If no overflow has
@@ -552,11 +541,11 @@ struct SynchLocksHeld {
552
541
 
553
542
  // A sentinel value in lists that is not 0.
554
543
  // A 0 value is used to mean "not on a list".
555
- static PerThreadSynch *const kPerThreadSynchNull =
556
- reinterpret_cast<PerThreadSynch *>(1);
544
+ static PerThreadSynch* const kPerThreadSynchNull =
545
+ reinterpret_cast<PerThreadSynch*>(1);
557
546
 
558
- static SynchLocksHeld *LocksHeldAlloc() {
559
- SynchLocksHeld *ret = reinterpret_cast<SynchLocksHeld *>(
547
+ static SynchLocksHeld* LocksHeldAlloc() {
548
+ SynchLocksHeld* ret = reinterpret_cast<SynchLocksHeld*>(
560
549
  base_internal::LowLevelAlloc::Alloc(sizeof(SynchLocksHeld)));
561
550
  ret->n = 0;
562
551
  ret->overflow = false;
@@ -564,24 +553,24 @@ static SynchLocksHeld *LocksHeldAlloc() {
564
553
  }
565
554
 
566
555
  // Return the PerThreadSynch-struct for this thread.
567
- static PerThreadSynch *Synch_GetPerThread() {
568
- ThreadIdentity *identity = GetOrCreateCurrentThreadIdentity();
556
+ static PerThreadSynch* Synch_GetPerThread() {
557
+ ThreadIdentity* identity = GetOrCreateCurrentThreadIdentity();
569
558
  return &identity->per_thread_synch;
570
559
  }
571
560
 
572
- static PerThreadSynch *Synch_GetPerThreadAnnotated(Mutex *mu) {
561
+ static PerThreadSynch* Synch_GetPerThreadAnnotated(Mutex* mu) {
573
562
  if (mu) {
574
563
  ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
575
564
  }
576
- PerThreadSynch *w = Synch_GetPerThread();
565
+ PerThreadSynch* w = Synch_GetPerThread();
577
566
  if (mu) {
578
567
  ABSL_TSAN_MUTEX_POST_DIVERT(mu, 0);
579
568
  }
580
569
  return w;
581
570
  }
582
571
 
583
- static SynchLocksHeld *Synch_GetAllLocks() {
584
- PerThreadSynch *s = Synch_GetPerThread();
572
+ static SynchLocksHeld* Synch_GetAllLocks() {
573
+ PerThreadSynch* s = Synch_GetPerThread();
585
574
  if (s->all_locks == nullptr) {
586
575
  s->all_locks = LocksHeldAlloc(); // Freed by ReclaimThreadIdentity.
587
576
  }
@@ -589,7 +578,7 @@ static SynchLocksHeld *Synch_GetAllLocks() {
589
578
  }
590
579
 
591
580
  // Post on "w"'s associated PerThreadSem.
592
- void Mutex::IncrementSynchSem(Mutex *mu, PerThreadSynch *w) {
581
+ void Mutex::IncrementSynchSem(Mutex* mu, PerThreadSynch* w) {
593
582
  if (mu) {
594
583
  ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
595
584
  // We miss synchronization around passing PerThreadSynch between threads
@@ -605,7 +594,7 @@ void Mutex::IncrementSynchSem(Mutex *mu, PerThreadSynch *w) {
605
594
  }
606
595
 
607
596
  // Wait on "w"'s associated PerThreadSem; returns false if timeout expired.
608
- bool Mutex::DecrementSynchSem(Mutex *mu, PerThreadSynch *w, KernelTimeout t) {
597
+ bool Mutex::DecrementSynchSem(Mutex* mu, PerThreadSynch* w, KernelTimeout t) {
609
598
  if (mu) {
610
599
  ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
611
600
  }
@@ -626,7 +615,7 @@ bool Mutex::DecrementSynchSem(Mutex *mu, PerThreadSynch *w, KernelTimeout t) {
626
615
  // Mutex code checking that the "waitp" field has not been reused.
627
616
  void Mutex::InternalAttemptToUseMutexInFatalSignalHandler() {
628
617
  // Fix the per-thread state only if it exists.
629
- ThreadIdentity *identity = CurrentThreadIdentityIfPresent();
618
+ ThreadIdentity* identity = CurrentThreadIdentityIfPresent();
630
619
  if (identity != nullptr) {
631
620
  identity->per_thread_synch.suppress_fatal_errors = true;
632
621
  }
@@ -635,21 +624,6 @@ void Mutex::InternalAttemptToUseMutexInFatalSignalHandler() {
635
624
  std::memory_order_release);
636
625
  }
637
626
 
638
- // --------------------------time support
639
-
640
- // Return the current time plus the timeout. Use the same clock as
641
- // PerThreadSem::Wait() for consistency. Unfortunately, we don't have
642
- // such a choice when a deadline is given directly.
643
- static absl::Time DeadlineFromTimeout(absl::Duration timeout) {
644
- #ifndef _WIN32
645
- struct timeval tv;
646
- gettimeofday(&tv, nullptr);
647
- return absl::TimeFromTimeval(tv) + timeout;
648
- #else
649
- return absl::Now() + timeout;
650
- #endif
651
- }
652
-
653
627
  // --------------------------Mutexes
654
628
 
655
629
  // In the layout below, the msb of the bottom byte is currently unused. Also,
@@ -660,24 +634,29 @@ static absl::Time DeadlineFromTimeout(absl::Duration timeout) {
660
634
  // bit-twiddling trick in Mutex::Unlock().
661
635
  // o kMuWriter / kMuReader == kMuWrWait / kMuWait,
662
636
  // to enable the bit-twiddling trick in CheckForMutexCorruption().
663
- static const intptr_t kMuReader = 0x0001L; // a reader holds the lock
664
- static const intptr_t kMuDesig = 0x0002L; // there's a designated waker
665
- static const intptr_t kMuWait = 0x0004L; // threads are waiting
666
- static const intptr_t kMuWriter = 0x0008L; // a writer holds the lock
667
- static const intptr_t kMuEvent = 0x0010L; // record this mutex's events
637
+ static const intptr_t kMuReader = 0x0001L; // a reader holds the lock
638
+ // There's a designated waker.
668
639
  // INVARIANT1: there's a thread that was blocked on the mutex, is
669
640
  // no longer, yet has not yet acquired the mutex. If there's a
670
641
  // designated waker, all threads can avoid taking the slow path in
671
642
  // unlock because the designated waker will subsequently acquire
672
643
  // the lock and wake someone. To maintain INVARIANT1 the bit is
673
644
  // set when a thread is unblocked(INV1a), and threads that were
674
- // unblocked reset the bit when they either acquire or re-block
675
- // (INV1b).
676
- static const intptr_t kMuWrWait = 0x0020L; // runnable writer is waiting
677
- // for a reader
678
- static const intptr_t kMuSpin = 0x0040L; // spinlock protects wait list
679
- static const intptr_t kMuLow = 0x00ffL; // mask all mutex bits
680
- static const intptr_t kMuHigh = ~kMuLow; // mask pointer/reader count
645
+ // unblocked reset the bit when they either acquire or re-block (INV1b).
646
+ static const intptr_t kMuDesig = 0x0002L;
647
+ static const intptr_t kMuWait = 0x0004L; // threads are waiting
648
+ static const intptr_t kMuWriter = 0x0008L; // a writer holds the lock
649
+ static const intptr_t kMuEvent = 0x0010L; // record this mutex's events
650
+ // Runnable writer is waiting for a reader.
651
+ // If set, new readers will not lock the mutex to avoid writer starvation.
652
+ // Note: if a reader has higher priority than the writer, it will still lock
653
+ // the mutex ahead of the waiting writer, but in a very inefficient manner:
654
+ // the reader will first queue itself and block, but then the last unlocking
655
+ // reader will wake it.
656
+ static const intptr_t kMuWrWait = 0x0020L;
657
+ static const intptr_t kMuSpin = 0x0040L; // spinlock protects wait list
658
+ static const intptr_t kMuLow = 0x00ffL; // mask all mutex bits
659
+ static const intptr_t kMuHigh = ~kMuLow; // mask pointer/reader count
681
660
 
682
661
  // Hack to make constant values available to gdb pretty printer
683
662
  enum {
@@ -773,8 +752,8 @@ Mutex::~Mutex() {
773
752
  ABSL_TSAN_MUTEX_DESTROY(this, __tsan_mutex_not_static);
774
753
  }
775
754
 
776
- void Mutex::EnableDebugLog(const char *name) {
777
- SynchEvent *e = EnsureSynchEvent(&this->mu_, name, kMuEvent, kMuSpin);
755
+ void Mutex::EnableDebugLog(const char* name) {
756
+ SynchEvent* e = EnsureSynchEvent(&this->mu_, name, kMuEvent, kMuSpin);
778
757
  e->log = true;
779
758
  UnrefSynchEvent(e);
780
759
  }
@@ -783,11 +762,10 @@ void EnableMutexInvariantDebugging(bool enabled) {
783
762
  synch_check_invariants.store(enabled, std::memory_order_release);
784
763
  }
785
764
 
786
- void Mutex::EnableInvariantDebugging(void (*invariant)(void *),
787
- void *arg) {
765
+ void Mutex::EnableInvariantDebugging(void (*invariant)(void*), void* arg) {
788
766
  if (synch_check_invariants.load(std::memory_order_acquire) &&
789
767
  invariant != nullptr) {
790
- SynchEvent *e = EnsureSynchEvent(&this->mu_, nullptr, kMuEvent, kMuSpin);
768
+ SynchEvent* e = EnsureSynchEvent(&this->mu_, nullptr, kMuEvent, kMuSpin);
791
769
  e->invariant = invariant;
792
770
  e->arg = arg;
793
771
  UnrefSynchEvent(e);
@@ -803,15 +781,15 @@ void SetMutexDeadlockDetectionMode(OnDeadlockCycle mode) {
803
781
  // waiters with the same condition, type of lock, and thread priority.
804
782
  //
805
783
  // Requires that x and y be waiting on the same Mutex queue.
806
- static bool MuEquivalentWaiter(PerThreadSynch *x, PerThreadSynch *y) {
784
+ static bool MuEquivalentWaiter(PerThreadSynch* x, PerThreadSynch* y) {
807
785
  return x->waitp->how == y->waitp->how && x->priority == y->priority &&
808
786
  Condition::GuaranteedEqual(x->waitp->cond, y->waitp->cond);
809
787
  }
810
788
 
811
789
  // Given the contents of a mutex word containing a PerThreadSynch pointer,
812
790
  // return the pointer.
813
- static inline PerThreadSynch *GetPerThreadSynch(intptr_t v) {
814
- return reinterpret_cast<PerThreadSynch *>(v & kMuHigh);
791
+ static inline PerThreadSynch* GetPerThreadSynch(intptr_t v) {
792
+ return reinterpret_cast<PerThreadSynch*>(v & kMuHigh);
815
793
  }
816
794
 
817
795
  // The next several routines maintain the per-thread next and skip fields
@@ -869,17 +847,17 @@ static inline PerThreadSynch *GetPerThreadSynch(intptr_t v) {
869
847
  // except those in the added node and the former "head" node. This implies
870
848
  // that the new node is added after head, and so must be the new head or the
871
849
  // new front of the queue.
872
- static PerThreadSynch *Skip(PerThreadSynch *x) {
873
- PerThreadSynch *x0 = nullptr;
874
- PerThreadSynch *x1 = x;
875
- PerThreadSynch *x2 = x->skip;
850
+ static PerThreadSynch* Skip(PerThreadSynch* x) {
851
+ PerThreadSynch* x0 = nullptr;
852
+ PerThreadSynch* x1 = x;
853
+ PerThreadSynch* x2 = x->skip;
876
854
  if (x2 != nullptr) {
877
855
  // Each iteration attempts to advance sequence (x0,x1,x2) to next sequence
878
856
  // such that x1 == x0->skip && x2 == x1->skip
879
857
  while ((x0 = x1, x1 = x2, x2 = x2->skip) != nullptr) {
880
- x0->skip = x2; // short-circuit skip from x0 to x2
858
+ x0->skip = x2; // short-circuit skip from x0 to x2
881
859
  }
882
- x->skip = x1; // short-circuit skip from x to result
860
+ x->skip = x1; // short-circuit skip from x to result
883
861
  }
884
862
  return x1;
885
863
  }
@@ -888,7 +866,7 @@ static PerThreadSynch *Skip(PerThreadSynch *x) {
888
866
  // The latter is going to be removed out of order, because of a timeout.
889
867
  // Check whether "ancestor" has a skip field pointing to "to_be_removed",
890
868
  // and fix it if it does.
891
- static void FixSkip(PerThreadSynch *ancestor, PerThreadSynch *to_be_removed) {
869
+ static void FixSkip(PerThreadSynch* ancestor, PerThreadSynch* to_be_removed) {
892
870
  if (ancestor->skip == to_be_removed) { // ancestor->skip left dangling
893
871
  if (to_be_removed->skip != nullptr) {
894
872
  ancestor->skip = to_be_removed->skip; // can skip past to_be_removed
@@ -900,7 +878,7 @@ static void FixSkip(PerThreadSynch *ancestor, PerThreadSynch *to_be_removed) {
900
878
  }
901
879
  }
902
880
 
903
- static void CondVarEnqueue(SynchWaitParams *waitp);
881
+ static void CondVarEnqueue(SynchWaitParams* waitp);
904
882
 
905
883
  // Enqueue thread "waitp->thread" on a waiter queue.
906
884
  // Called with mutex spinlock held if head != nullptr
@@ -921,8 +899,8 @@ static void CondVarEnqueue(SynchWaitParams *waitp);
921
899
  // returned. This mechanism is used by CondVar to queue a thread on the
922
900
  // condition variable queue instead of the mutex queue in implementing Wait().
923
901
  // In this case, Enqueue() can return nullptr (if head==nullptr).
924
- static PerThreadSynch *Enqueue(PerThreadSynch *head,
925
- SynchWaitParams *waitp, intptr_t mu, int flags) {
902
+ static PerThreadSynch* Enqueue(PerThreadSynch* head, SynchWaitParams* waitp,
903
+ intptr_t mu, int flags) {
926
904
  // If we have been given a cv_word, call CondVarEnqueue() and return
927
905
  // the previous head of the Mutex waiter queue.
928
906
  if (waitp->cv_word != nullptr) {
@@ -930,42 +908,43 @@ static PerThreadSynch *Enqueue(PerThreadSynch *head,
930
908
  return head;
931
909
  }
932
910
 
933
- PerThreadSynch *s = waitp->thread;
911
+ PerThreadSynch* s = waitp->thread;
934
912
  ABSL_RAW_CHECK(
935
913
  s->waitp == nullptr || // normal case
936
914
  s->waitp == waitp || // Fer()---transfer from condition variable
937
915
  s->suppress_fatal_errors,
938
916
  "detected illegal recursion into Mutex code");
939
917
  s->waitp = waitp;
940
- s->skip = nullptr; // maintain skip invariant (see above)
941
- s->may_skip = true; // always true on entering queue
942
- s->wake = false; // not being woken
918
+ s->skip = nullptr; // maintain skip invariant (see above)
919
+ s->may_skip = true; // always true on entering queue
920
+ s->wake = false; // not being woken
943
921
  s->cond_waiter = ((flags & kMuIsCond) != 0);
922
+ #ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM
923
+ int64_t now_cycles = CycleClock::Now();
924
+ if (s->next_priority_read_cycles < now_cycles) {
925
+ // Every so often, update our idea of the thread's priority.
926
+ // pthread_getschedparam() is 5% of the block/wakeup time;
927
+ // CycleClock::Now() is 0.5%.
928
+ int policy;
929
+ struct sched_param param;
930
+ const int err = pthread_getschedparam(pthread_self(), &policy, &param);
931
+ if (err != 0) {
932
+ ABSL_RAW_LOG(ERROR, "pthread_getschedparam failed: %d", err);
933
+ } else {
934
+ s->priority = param.sched_priority;
935
+ s->next_priority_read_cycles =
936
+ now_cycles + static_cast<int64_t>(CycleClock::Frequency());
937
+ }
938
+ }
939
+ #endif
944
940
  if (head == nullptr) { // s is the only waiter
945
941
  s->next = s; // it's the only entry in the cycle
946
942
  s->readers = mu; // reader count is from mu word
947
943
  s->maybe_unlocking = false; // no one is searching an empty list
948
944
  head = s; // s is new head
949
945
  } else {
950
- PerThreadSynch *enqueue_after = nullptr; // we'll put s after this element
946
+ PerThreadSynch* enqueue_after = nullptr; // we'll put s after this element
951
947
  #ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM
952
- int64_t now_cycles = base_internal::CycleClock::Now();
953
- if (s->next_priority_read_cycles < now_cycles) {
954
- // Every so often, update our idea of the thread's priority.
955
- // pthread_getschedparam() is 5% of the block/wakeup time;
956
- // base_internal::CycleClock::Now() is 0.5%.
957
- int policy;
958
- struct sched_param param;
959
- const int err = pthread_getschedparam(pthread_self(), &policy, &param);
960
- if (err != 0) {
961
- ABSL_RAW_LOG(ERROR, "pthread_getschedparam failed: %d", err);
962
- } else {
963
- s->priority = param.sched_priority;
964
- s->next_priority_read_cycles =
965
- now_cycles +
966
- static_cast<int64_t>(base_internal::CycleClock::Frequency());
967
- }
968
- }
969
948
  if (s->priority > head->priority) { // s's priority is above head's
970
949
  // try to put s in priority-fifo order, or failing that at the front.
971
950
  if (!head->maybe_unlocking) {
@@ -975,20 +954,20 @@ static PerThreadSynch *Enqueue(PerThreadSynch *head,
975
954
  // Within a skip chain, all waiters have the same priority, so we can
976
955
  // skip forward through the chains until we find one with a lower
977
956
  // priority than the waiter to be enqueued.
978
- PerThreadSynch *advance_to = head; // next value of enqueue_after
957
+ PerThreadSynch* advance_to = head; // next value of enqueue_after
979
958
  do {
980
959
  enqueue_after = advance_to;
981
960
  // (side-effect: optimizes skip chain)
982
961
  advance_to = Skip(enqueue_after->next);
983
962
  } while (s->priority <= advance_to->priority);
984
- // termination guaranteed because s->priority > head->priority
985
- // and head is the end of a skip chain
963
+ // termination guaranteed because s->priority > head->priority
964
+ // and head is the end of a skip chain
986
965
  } else if (waitp->how == kExclusive &&
987
966
  Condition::GuaranteedEqual(waitp->cond, nullptr)) {
988
967
  // An unlocker could be scanning the queue, but we know it will recheck
989
968
  // the queue front for writers that have no condition, which is what s
990
969
  // is, so an insert at front is safe.
991
- enqueue_after = head; // add after head, at front
970
+ enqueue_after = head; // add after head, at front
992
971
  }
993
972
  }
994
973
  #endif
@@ -1013,12 +992,12 @@ static PerThreadSynch *Enqueue(PerThreadSynch *head,
1013
992
  enqueue_after->skip = enqueue_after->next;
1014
993
  }
1015
994
  if (MuEquivalentWaiter(s, s->next)) { // s->may_skip is known to be true
1016
- s->skip = s->next; // s may skip to its successor
995
+ s->skip = s->next; // s may skip to its successor
1017
996
  }
1018
- } else { // enqueue not done any other way, so
1019
- // we're inserting s at the back
997
+ } else { // enqueue not done any other way, so
998
+ // we're inserting s at the back
1020
999
  // s will become new head; copy data from head into it
1021
- s->next = head->next; // add s after head
1000
+ s->next = head->next; // add s after head
1022
1001
  head->next = s;
1023
1002
  s->readers = head->readers; // reader count is from previous head
1024
1003
  s->maybe_unlocking = head->maybe_unlocking; // same for unlock hint
@@ -1037,17 +1016,17 @@ static PerThreadSynch *Enqueue(PerThreadSynch *head,
1037
1016
  // whose last element is head. The new head element is returned, or null
1038
1017
  // if the list is made empty.
1039
1018
  // Dequeue is called with both spinlock and Mutex held.
1040
- static PerThreadSynch *Dequeue(PerThreadSynch *head, PerThreadSynch *pw) {
1041
- PerThreadSynch *w = pw->next;
1042
- pw->next = w->next; // snip w out of list
1043
- if (head == w) { // we removed the head
1019
+ static PerThreadSynch* Dequeue(PerThreadSynch* head, PerThreadSynch* pw) {
1020
+ PerThreadSynch* w = pw->next;
1021
+ pw->next = w->next; // snip w out of list
1022
+ if (head == w) { // we removed the head
1044
1023
  head = (pw == w) ? nullptr : pw; // either emptied list, or pw is new head
1045
1024
  } else if (pw != head && MuEquivalentWaiter(pw, pw->next)) {
1046
1025
  // pw can skip to its new successor
1047
1026
  if (pw->next->skip !=
1048
1027
  nullptr) { // either skip to its successors skip target
1049
1028
  pw->skip = pw->next->skip;
1050
- } else { // or to pw's successor
1029
+ } else { // or to pw's successor
1051
1030
  pw->skip = pw->next;
1052
1031
  }
1053
1032
  }
@@ -1060,27 +1039,27 @@ static PerThreadSynch *Dequeue(PerThreadSynch *head, PerThreadSynch *pw) {
1060
1039
  // singly-linked list wake_list in the order found. Assumes that
1061
1040
  // there is only one such element if the element has how == kExclusive.
1062
1041
  // Return the new head.
1063
- static PerThreadSynch *DequeueAllWakeable(PerThreadSynch *head,
1064
- PerThreadSynch *pw,
1065
- PerThreadSynch **wake_tail) {
1066
- PerThreadSynch *orig_h = head;
1067
- PerThreadSynch *w = pw->next;
1042
+ static PerThreadSynch* DequeueAllWakeable(PerThreadSynch* head,
1043
+ PerThreadSynch* pw,
1044
+ PerThreadSynch** wake_tail) {
1045
+ PerThreadSynch* orig_h = head;
1046
+ PerThreadSynch* w = pw->next;
1068
1047
  bool skipped = false;
1069
1048
  do {
1070
- if (w->wake) { // remove this element
1049
+ if (w->wake) { // remove this element
1071
1050
  ABSL_RAW_CHECK(pw->skip == nullptr, "bad skip in DequeueAllWakeable");
1072
1051
  // we're removing pw's successor so either pw->skip is zero or we should
1073
1052
  // already have removed pw since if pw->skip!=null, pw has the same
1074
1053
  // condition as w.
1075
1054
  head = Dequeue(head, pw);
1076
- w->next = *wake_tail; // keep list terminated
1077
- *wake_tail = w; // add w to wake_list;
1078
- wake_tail = &w->next; // next addition to end
1055
+ w->next = *wake_tail; // keep list terminated
1056
+ *wake_tail = w; // add w to wake_list;
1057
+ wake_tail = &w->next; // next addition to end
1079
1058
  if (w->waitp->how == kExclusive) { // wake at most 1 writer
1080
1059
  break;
1081
1060
  }
1082
- } else { // not waking this one; skip
1083
- pw = Skip(w); // skip as much as possible
1061
+ } else { // not waking this one; skip
1062
+ pw = Skip(w); // skip as much as possible
1084
1063
  skipped = true;
1085
1064
  }
1086
1065
  w = pw->next;
@@ -1098,7 +1077,7 @@ static PerThreadSynch *DequeueAllWakeable(PerThreadSynch *head,
1098
1077
 
1099
1078
  // Try to remove thread s from the list of waiters on this mutex.
1100
1079
  // Does nothing if s is not on the waiter list.
1101
- void Mutex::TryRemove(PerThreadSynch *s) {
1080
+ void Mutex::TryRemove(PerThreadSynch* s) {
1102
1081
  SchedulingGuard::ScopedDisable disable_rescheduling;
1103
1082
  intptr_t v = mu_.load(std::memory_order_relaxed);
1104
1083
  // acquire spinlock & lock
@@ -1106,16 +1085,16 @@ void Mutex::TryRemove(PerThreadSynch *s) {
1106
1085
  mu_.compare_exchange_strong(v, v | kMuSpin | kMuWriter,
1107
1086
  std::memory_order_acquire,
1108
1087
  std::memory_order_relaxed)) {
1109
- PerThreadSynch *h = GetPerThreadSynch(v);
1088
+ PerThreadSynch* h = GetPerThreadSynch(v);
1110
1089
  if (h != nullptr) {
1111
- PerThreadSynch *pw = h; // pw is w's predecessor
1112
- PerThreadSynch *w;
1090
+ PerThreadSynch* pw = h; // pw is w's predecessor
1091
+ PerThreadSynch* w;
1113
1092
  if ((w = pw->next) != s) { // search for thread,
1114
1093
  do { // processing at least one element
1115
1094
  // If the current element isn't equivalent to the waiter to be
1116
1095
  // removed, we can skip the entire chain.
1117
1096
  if (!MuEquivalentWaiter(s, w)) {
1118
- pw = Skip(w); // so skip all that won't match
1097
+ pw = Skip(w); // so skip all that won't match
1119
1098
  // we don't have to worry about dangling skip fields
1120
1099
  // in the threads we skipped; none can point to s
1121
1100
  // because they are in a different equivalence class.
@@ -1127,7 +1106,7 @@ void Mutex::TryRemove(PerThreadSynch *s) {
1127
1106
  // process the first thread again.
1128
1107
  } while ((w = pw->next) != s && pw != h);
1129
1108
  }
1130
- if (w == s) { // found thread; remove it
1109
+ if (w == s) { // found thread; remove it
1131
1110
  // pw->skip may be non-zero here; the loop above ensured that
1132
1111
  // no ancestor of s can skip to s, so removal is safe anyway.
1133
1112
  h = Dequeue(h, pw);
@@ -1136,16 +1115,15 @@ void Mutex::TryRemove(PerThreadSynch *s) {
1136
1115
  }
1137
1116
  }
1138
1117
  intptr_t nv;
1139
- do { // release spinlock and lock
1118
+ do { // release spinlock and lock
1140
1119
  v = mu_.load(std::memory_order_relaxed);
1141
1120
  nv = v & (kMuDesig | kMuEvent);
1142
1121
  if (h != nullptr) {
1143
1122
  nv |= kMuWait | reinterpret_cast<intptr_t>(h);
1144
- h->readers = 0; // we hold writer lock
1123
+ h->readers = 0; // we hold writer lock
1145
1124
  h->maybe_unlocking = false; // finished unlocking
1146
1125
  }
1147
- } while (!mu_.compare_exchange_weak(v, nv,
1148
- std::memory_order_release,
1126
+ } while (!mu_.compare_exchange_weak(v, nv, std::memory_order_release,
1149
1127
  std::memory_order_relaxed));
1150
1128
  }
1151
1129
  }
@@ -1155,7 +1133,7 @@ void Mutex::TryRemove(PerThreadSynch *s) {
1155
1133
  // if the wait extends past the absolute time specified, even if "s" is still
1156
1134
  // on the mutex queue. In this case, remove "s" from the queue and return
1157
1135
  // true, otherwise return false.
1158
- void Mutex::Block(PerThreadSynch *s) {
1136
+ void Mutex::Block(PerThreadSynch* s) {
1159
1137
  while (s->state.load(std::memory_order_acquire) == PerThreadSynch::kQueued) {
1160
1138
  if (!DecrementSynchSem(this, s, s->waitp->timeout)) {
1161
1139
  // After a timeout, we go into a spin loop until we remove ourselves
@@ -1174,7 +1152,7 @@ void Mutex::Block(PerThreadSynch *s) {
1174
1152
  // is not on the queue.
1175
1153
  this->TryRemove(s);
1176
1154
  }
1177
- s->waitp->timeout = KernelTimeout::Never(); // timeout is satisfied
1155
+ s->waitp->timeout = KernelTimeout::Never(); // timeout is satisfied
1178
1156
  s->waitp->cond = nullptr; // condition no longer relevant for wakeups
1179
1157
  }
1180
1158
  }
@@ -1184,8 +1162,8 @@ void Mutex::Block(PerThreadSynch *s) {
1184
1162
  }
1185
1163
 
1186
1164
  // Wake thread w, and return the next thread in the list.
1187
- PerThreadSynch *Mutex::Wakeup(PerThreadSynch *w) {
1188
- PerThreadSynch *next = w->next;
1165
+ PerThreadSynch* Mutex::Wakeup(PerThreadSynch* w) {
1166
+ PerThreadSynch* next = w->next;
1189
1167
  w->next = nullptr;
1190
1168
  w->state.store(PerThreadSynch::kAvailable, std::memory_order_release);
1191
1169
  IncrementSynchSem(this, w);
@@ -1193,7 +1171,7 @@ PerThreadSynch *Mutex::Wakeup(PerThreadSynch *w) {
1193
1171
  return next;
1194
1172
  }
1195
1173
 
1196
- static GraphId GetGraphIdLocked(Mutex *mu)
1174
+ static GraphId GetGraphIdLocked(Mutex* mu)
1197
1175
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(deadlock_graph_mu) {
1198
1176
  if (!deadlock_graph) { // (re)create the deadlock graph.
1199
1177
  deadlock_graph =
@@ -1203,7 +1181,7 @@ static GraphId GetGraphIdLocked(Mutex *mu)
1203
1181
  return deadlock_graph->GetId(mu);
1204
1182
  }
1205
1183
 
1206
- static GraphId GetGraphId(Mutex *mu) ABSL_LOCKS_EXCLUDED(deadlock_graph_mu) {
1184
+ static GraphId GetGraphId(Mutex* mu) ABSL_LOCKS_EXCLUDED(deadlock_graph_mu) {
1207
1185
  deadlock_graph_mu.Lock();
1208
1186
  GraphId id = GetGraphIdLocked(mu);
1209
1187
  deadlock_graph_mu.Unlock();
@@ -1213,7 +1191,7 @@ static GraphId GetGraphId(Mutex *mu) ABSL_LOCKS_EXCLUDED(deadlock_graph_mu) {
1213
1191
  // Record a lock acquisition. This is used in debug mode for deadlock
1214
1192
  // detection. The held_locks pointer points to the relevant data
1215
1193
  // structure for each case.
1216
- static void LockEnter(Mutex* mu, GraphId id, SynchLocksHeld *held_locks) {
1194
+ static void LockEnter(Mutex* mu, GraphId id, SynchLocksHeld* held_locks) {
1217
1195
  int n = held_locks->n;
1218
1196
  int i = 0;
1219
1197
  while (i != n && held_locks->locks[i].id != id) {
@@ -1237,7 +1215,7 @@ static void LockEnter(Mutex* mu, GraphId id, SynchLocksHeld *held_locks) {
1237
1215
  // eventually followed by a call to LockLeave(mu, id, x) by the same thread.
1238
1216
  // It does not process the event if is not needed when deadlock detection is
1239
1217
  // disabled.
1240
- static void LockLeave(Mutex* mu, GraphId id, SynchLocksHeld *held_locks) {
1218
+ static void LockLeave(Mutex* mu, GraphId id, SynchLocksHeld* held_locks) {
1241
1219
  int n = held_locks->n;
1242
1220
  int i = 0;
1243
1221
  while (i != n && held_locks->locks[i].id != id) {
@@ -1252,11 +1230,11 @@ static void LockLeave(Mutex* mu, GraphId id, SynchLocksHeld *held_locks) {
1252
1230
  i++;
1253
1231
  }
1254
1232
  if (i == n) { // mu missing means releasing unheld lock
1255
- SynchEvent *mu_events = GetSynchEvent(mu);
1233
+ SynchEvent* mu_events = GetSynchEvent(mu);
1256
1234
  ABSL_RAW_LOG(FATAL,
1257
1235
  "thread releasing lock it does not hold: %p %s; "
1258
1236
  ,
1259
- static_cast<void *>(mu),
1237
+ static_cast<void*>(mu),
1260
1238
  mu_events == nullptr ? "" : mu_events->name);
1261
1239
  }
1262
1240
  }
@@ -1273,7 +1251,7 @@ static void LockLeave(Mutex* mu, GraphId id, SynchLocksHeld *held_locks) {
1273
1251
  }
1274
1252
 
1275
1253
  // Call LockEnter() if in debug mode and deadlock detection is enabled.
1276
- static inline void DebugOnlyLockEnter(Mutex *mu) {
1254
+ static inline void DebugOnlyLockEnter(Mutex* mu) {
1277
1255
  if (kDebugMode) {
1278
1256
  if (synch_deadlock_detection.load(std::memory_order_acquire) !=
1279
1257
  OnDeadlockCycle::kIgnore) {
@@ -1283,7 +1261,7 @@ static inline void DebugOnlyLockEnter(Mutex *mu) {
1283
1261
  }
1284
1262
 
1285
1263
  // Call LockEnter() if in debug mode and deadlock detection is enabled.
1286
- static inline void DebugOnlyLockEnter(Mutex *mu, GraphId id) {
1264
+ static inline void DebugOnlyLockEnter(Mutex* mu, GraphId id) {
1287
1265
  if (kDebugMode) {
1288
1266
  if (synch_deadlock_detection.load(std::memory_order_acquire) !=
1289
1267
  OnDeadlockCycle::kIgnore) {
@@ -1293,7 +1271,7 @@ static inline void DebugOnlyLockEnter(Mutex *mu, GraphId id) {
1293
1271
  }
1294
1272
 
1295
1273
  // Call LockLeave() if in debug mode and deadlock detection is enabled.
1296
- static inline void DebugOnlyLockLeave(Mutex *mu) {
1274
+ static inline void DebugOnlyLockLeave(Mutex* mu) {
1297
1275
  if (kDebugMode) {
1298
1276
  if (synch_deadlock_detection.load(std::memory_order_acquire) !=
1299
1277
  OnDeadlockCycle::kIgnore) {
@@ -1302,9 +1280,9 @@ static inline void DebugOnlyLockLeave(Mutex *mu) {
1302
1280
  }
1303
1281
  }
1304
1282
 
1305
- static char *StackString(void **pcs, int n, char *buf, int maxlen,
1283
+ static char* StackString(void** pcs, int n, char* buf, int maxlen,
1306
1284
  bool symbolize) {
1307
- static const int kSymLen = 200;
1285
+ static constexpr int kSymLen = 200;
1308
1286
  char sym[kSymLen];
1309
1287
  int len = 0;
1310
1288
  for (int i = 0; i != n; i++) {
@@ -1312,7 +1290,7 @@ static char *StackString(void **pcs, int n, char *buf, int maxlen,
1312
1290
  return buf;
1313
1291
  size_t count = static_cast<size_t>(maxlen - len);
1314
1292
  if (symbolize) {
1315
- if (!symbolizer(pcs[i], sym, kSymLen)) {
1293
+ if (!absl::Symbolize(pcs[i], sym, kSymLen)) {
1316
1294
  sym[0] = '\0';
1317
1295
  }
1318
1296
  snprintf(buf + len, count, "%s\t@ %p %s\n", (i == 0 ? "\n" : ""), pcs[i],
@@ -1325,15 +1303,17 @@ static char *StackString(void **pcs, int n, char *buf, int maxlen,
1325
1303
  return buf;
1326
1304
  }
1327
1305
 
1328
- static char *CurrentStackString(char *buf, int maxlen, bool symbolize) {
1329
- void *pcs[40];
1306
+ static char* CurrentStackString(char* buf, int maxlen, bool symbolize) {
1307
+ void* pcs[40];
1330
1308
  return StackString(pcs, absl::GetStackTrace(pcs, ABSL_ARRAYSIZE(pcs), 2), buf,
1331
1309
  maxlen, symbolize);
1332
1310
  }
1333
1311
 
1334
1312
  namespace {
1335
- enum { kMaxDeadlockPathLen = 10 }; // maximum length of a deadlock cycle;
1336
- // a path this long would be remarkable
1313
+ enum {
1314
+ kMaxDeadlockPathLen = 10
1315
+ }; // maximum length of a deadlock cycle;
1316
+ // a path this long would be remarkable
1337
1317
  // Buffers required to report a deadlock.
1338
1318
  // We do not allocate them on stack to avoid large stack frame.
1339
1319
  struct DeadlockReportBuffers {
@@ -1343,11 +1323,11 @@ struct DeadlockReportBuffers {
1343
1323
 
1344
1324
  struct ScopedDeadlockReportBuffers {
1345
1325
  ScopedDeadlockReportBuffers() {
1346
- b = reinterpret_cast<DeadlockReportBuffers *>(
1326
+ b = reinterpret_cast<DeadlockReportBuffers*>(
1347
1327
  base_internal::LowLevelAlloc::Alloc(sizeof(*b)));
1348
1328
  }
1349
1329
  ~ScopedDeadlockReportBuffers() { base_internal::LowLevelAlloc::Free(b); }
1350
- DeadlockReportBuffers *b;
1330
+ DeadlockReportBuffers* b;
1351
1331
  };
1352
1332
 
1353
1333
  // Helper to pass to GraphCycles::UpdateStackTrace.
@@ -1358,13 +1338,13 @@ int GetStack(void** stack, int max_depth) {
1358
1338
 
1359
1339
  // Called in debug mode when a thread is about to acquire a lock in a way that
1360
1340
  // may block.
1361
- static GraphId DeadlockCheck(Mutex *mu) {
1341
+ static GraphId DeadlockCheck(Mutex* mu) {
1362
1342
  if (synch_deadlock_detection.load(std::memory_order_acquire) ==
1363
1343
  OnDeadlockCycle::kIgnore) {
1364
1344
  return InvalidGraphId();
1365
1345
  }
1366
1346
 
1367
- SynchLocksHeld *all_locks = Synch_GetAllLocks();
1347
+ SynchLocksHeld* all_locks = Synch_GetAllLocks();
1368
1348
 
1369
1349
  absl::base_internal::SpinLockHolder lock(&deadlock_graph_mu);
1370
1350
  const GraphId mu_id = GetGraphIdLocked(mu);
@@ -1386,8 +1366,8 @@ static GraphId DeadlockCheck(Mutex *mu) {
1386
1366
  // For each other mutex already held by this thread:
1387
1367
  for (int i = 0; i != all_locks->n; i++) {
1388
1368
  const GraphId other_node_id = all_locks->locks[i].id;
1389
- const Mutex *other =
1390
- static_cast<const Mutex *>(deadlock_graph->Ptr(other_node_id));
1369
+ const Mutex* other =
1370
+ static_cast<const Mutex*>(deadlock_graph->Ptr(other_node_id));
1391
1371
  if (other == nullptr) {
1392
1372
  // Ignore stale lock
1393
1373
  continue;
@@ -1396,7 +1376,7 @@ static GraphId DeadlockCheck(Mutex *mu) {
1396
1376
  // Add the acquired-before edge to the graph.
1397
1377
  if (!deadlock_graph->InsertEdge(other_node_id, mu_id)) {
1398
1378
  ScopedDeadlockReportBuffers scoped_buffers;
1399
- DeadlockReportBuffers *b = scoped_buffers.b;
1379
+ DeadlockReportBuffers* b = scoped_buffers.b;
1400
1380
  static int number_of_reported_deadlocks = 0;
1401
1381
  number_of_reported_deadlocks++;
1402
1382
  // Symbolize only 2 first deadlock report to avoid huge slowdowns.
@@ -1407,37 +1387,40 @@ static GraphId DeadlockCheck(Mutex *mu) {
1407
1387
  for (int j = 0; j != all_locks->n; j++) {
1408
1388
  void* pr = deadlock_graph->Ptr(all_locks->locks[j].id);
1409
1389
  if (pr != nullptr) {
1410
- snprintf(b->buf + len, sizeof (b->buf) - len, " %p", pr);
1390
+ snprintf(b->buf + len, sizeof(b->buf) - len, " %p", pr);
1411
1391
  len += strlen(&b->buf[len]);
1412
1392
  }
1413
1393
  }
1414
1394
  ABSL_RAW_LOG(ERROR,
1415
1395
  "Acquiring absl::Mutex %p while holding %s; a cycle in the "
1416
1396
  "historical lock ordering graph has been observed",
1417
- static_cast<void *>(mu), b->buf);
1397
+ static_cast<void*>(mu), b->buf);
1418
1398
  ABSL_RAW_LOG(ERROR, "Cycle: ");
1419
- int path_len = deadlock_graph->FindPath(
1420
- mu_id, other_node_id, ABSL_ARRAYSIZE(b->path), b->path);
1421
- for (int j = 0; j != path_len; j++) {
1399
+ int path_len = deadlock_graph->FindPath(mu_id, other_node_id,
1400
+ ABSL_ARRAYSIZE(b->path), b->path);
1401
+ for (int j = 0; j != path_len && j != ABSL_ARRAYSIZE(b->path); j++) {
1422
1402
  GraphId id = b->path[j];
1423
- Mutex *path_mu = static_cast<Mutex *>(deadlock_graph->Ptr(id));
1403
+ Mutex* path_mu = static_cast<Mutex*>(deadlock_graph->Ptr(id));
1424
1404
  if (path_mu == nullptr) continue;
1425
1405
  void** stack;
1426
1406
  int depth = deadlock_graph->GetStackTrace(id, &stack);
1427
1407
  snprintf(b->buf, sizeof(b->buf),
1428
- "mutex@%p stack: ", static_cast<void *>(path_mu));
1408
+ "mutex@%p stack: ", static_cast<void*>(path_mu));
1429
1409
  StackString(stack, depth, b->buf + strlen(b->buf),
1430
1410
  static_cast<int>(sizeof(b->buf) - strlen(b->buf)),
1431
1411
  symbolize);
1432
1412
  ABSL_RAW_LOG(ERROR, "%s", b->buf);
1433
1413
  }
1414
+ if (path_len > static_cast<int>(ABSL_ARRAYSIZE(b->path))) {
1415
+ ABSL_RAW_LOG(ERROR, "(long cycle; list truncated)");
1416
+ }
1434
1417
  if (synch_deadlock_detection.load(std::memory_order_acquire) ==
1435
1418
  OnDeadlockCycle::kAbort) {
1436
1419
  deadlock_graph_mu.Unlock(); // avoid deadlock in fatal sighandler
1437
1420
  ABSL_RAW_LOG(FATAL, "dying due to potential deadlock");
1438
1421
  return mu_id;
1439
1422
  }
1440
- break; // report at most one potential deadlock per acquisition
1423
+ break; // report at most one potential deadlock per acquisition
1441
1424
  }
1442
1425
  }
1443
1426
 
@@ -1446,7 +1429,7 @@ static GraphId DeadlockCheck(Mutex *mu) {
1446
1429
 
1447
1430
  // Invoke DeadlockCheck() iff we're in debug mode and
1448
1431
  // deadlock checking has been enabled.
1449
- static inline GraphId DebugOnlyDeadlockCheck(Mutex *mu) {
1432
+ static inline GraphId DebugOnlyDeadlockCheck(Mutex* mu) {
1450
1433
  if (kDebugMode && synch_deadlock_detection.load(std::memory_order_acquire) !=
1451
1434
  OnDeadlockCycle::kIgnore) {
1452
1435
  return DeadlockCheck(mu);
@@ -1473,13 +1456,13 @@ void Mutex::AssertNotHeld() const {
1473
1456
  (mu_.load(std::memory_order_relaxed) & (kMuWriter | kMuReader)) != 0 &&
1474
1457
  synch_deadlock_detection.load(std::memory_order_acquire) !=
1475
1458
  OnDeadlockCycle::kIgnore) {
1476
- GraphId id = GetGraphId(const_cast<Mutex *>(this));
1477
- SynchLocksHeld *locks = Synch_GetAllLocks();
1459
+ GraphId id = GetGraphId(const_cast<Mutex*>(this));
1460
+ SynchLocksHeld* locks = Synch_GetAllLocks();
1478
1461
  for (int i = 0; i != locks->n; i++) {
1479
1462
  if (locks->locks[i].id == id) {
1480
- SynchEvent *mu_events = GetSynchEvent(this);
1463
+ SynchEvent* mu_events = GetSynchEvent(this);
1481
1464
  ABSL_RAW_LOG(FATAL, "thread should not hold mutex %p %s",
1482
- static_cast<const void *>(this),
1465
+ static_cast<const void*>(this),
1483
1466
  (mu_events == nullptr ? "" : mu_events->name));
1484
1467
  }
1485
1468
  }
@@ -1492,8 +1475,8 @@ static bool TryAcquireWithSpinning(std::atomic<intptr_t>* mu) {
1492
1475
  int c = GetMutexGlobals().spinloop_iterations;
1493
1476
  do { // do/while somewhat faster on AMD
1494
1477
  intptr_t v = mu->load(std::memory_order_relaxed);
1495
- if ((v & (kMuReader|kMuEvent)) != 0) {
1496
- return false; // a reader or tracing -> give up
1478
+ if ((v & (kMuReader | kMuEvent)) != 0) {
1479
+ return false; // a reader or tracing -> give up
1497
1480
  } else if (((v & kMuWriter) == 0) && // no holder -> try to acquire
1498
1481
  mu->compare_exchange_strong(v, kMuWriter | v,
1499
1482
  std::memory_order_acquire,
@@ -1510,8 +1493,7 @@ void Mutex::Lock() {
1510
1493
  intptr_t v = mu_.load(std::memory_order_relaxed);
1511
1494
  // try fast acquire, then spin loop
1512
1495
  if ((v & (kMuWriter | kMuReader | kMuEvent)) != 0 ||
1513
- !mu_.compare_exchange_strong(v, kMuWriter | v,
1514
- std::memory_order_acquire,
1496
+ !mu_.compare_exchange_strong(v, kMuWriter | v, std::memory_order_acquire,
1515
1497
  std::memory_order_relaxed)) {
1516
1498
  // try spin acquire, then slow loop
1517
1499
  if (!TryAcquireWithSpinning(&this->mu_)) {
@@ -1537,7 +1519,7 @@ void Mutex::ReaderLock() {
1537
1519
  ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_read_lock, 0);
1538
1520
  }
1539
1521
 
1540
- void Mutex::LockWhen(const Condition &cond) {
1522
+ void Mutex::LockWhen(const Condition& cond) {
1541
1523
  ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
1542
1524
  GraphId id = DebugOnlyDeadlockCheck(this);
1543
1525
  this->LockSlow(kExclusive, &cond, 0);
@@ -1545,21 +1527,26 @@ void Mutex::LockWhen(const Condition &cond) {
1545
1527
  ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
1546
1528
  }
1547
1529
 
1548
- bool Mutex::LockWhenWithTimeout(const Condition &cond, absl::Duration timeout) {
1549
- return LockWhenWithDeadline(cond, DeadlineFromTimeout(timeout));
1530
+ bool Mutex::LockWhenWithTimeout(const Condition& cond, absl::Duration timeout) {
1531
+ ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
1532
+ GraphId id = DebugOnlyDeadlockCheck(this);
1533
+ bool res = LockSlowWithDeadline(kExclusive, &cond, KernelTimeout(timeout), 0);
1534
+ DebugOnlyLockEnter(this, id);
1535
+ ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
1536
+ return res;
1550
1537
  }
1551
1538
 
1552
- bool Mutex::LockWhenWithDeadline(const Condition &cond, absl::Time deadline) {
1539
+ bool Mutex::LockWhenWithDeadline(const Condition& cond, absl::Time deadline) {
1553
1540
  ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
1554
1541
  GraphId id = DebugOnlyDeadlockCheck(this);
1555
- bool res = LockSlowWithDeadline(kExclusive, &cond,
1556
- KernelTimeout(deadline), 0);
1542
+ bool res =
1543
+ LockSlowWithDeadline(kExclusive, &cond, KernelTimeout(deadline), 0);
1557
1544
  DebugOnlyLockEnter(this, id);
1558
1545
  ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
1559
1546
  return res;
1560
1547
  }
1561
1548
 
1562
- void Mutex::ReaderLockWhen(const Condition &cond) {
1549
+ void Mutex::ReaderLockWhen(const Condition& cond) {
1563
1550
  ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
1564
1551
  GraphId id = DebugOnlyDeadlockCheck(this);
1565
1552
  this->LockSlow(kShared, &cond, 0);
@@ -1567,12 +1554,17 @@ void Mutex::ReaderLockWhen(const Condition &cond) {
1567
1554
  ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_read_lock, 0);
1568
1555
  }
1569
1556
 
1570
- bool Mutex::ReaderLockWhenWithTimeout(const Condition &cond,
1557
+ bool Mutex::ReaderLockWhenWithTimeout(const Condition& cond,
1571
1558
  absl::Duration timeout) {
1572
- return ReaderLockWhenWithDeadline(cond, DeadlineFromTimeout(timeout));
1559
+ ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
1560
+ GraphId id = DebugOnlyDeadlockCheck(this);
1561
+ bool res = LockSlowWithDeadline(kShared, &cond, KernelTimeout(timeout), 0);
1562
+ DebugOnlyLockEnter(this, id);
1563
+ ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_read_lock, 0);
1564
+ return res;
1573
1565
  }
1574
1566
 
1575
- bool Mutex::ReaderLockWhenWithDeadline(const Condition &cond,
1567
+ bool Mutex::ReaderLockWhenWithDeadline(const Condition& cond,
1576
1568
  absl::Time deadline) {
1577
1569
  ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
1578
1570
  GraphId id = DebugOnlyDeadlockCheck(this);
@@ -1582,23 +1574,34 @@ bool Mutex::ReaderLockWhenWithDeadline(const Condition &cond,
1582
1574
  return res;
1583
1575
  }
1584
1576
 
1585
- void Mutex::Await(const Condition &cond) {
1586
- if (cond.Eval()) { // condition already true; nothing to do
1577
+ void Mutex::Await(const Condition& cond) {
1578
+ if (cond.Eval()) { // condition already true; nothing to do
1587
1579
  if (kDebugMode) {
1588
1580
  this->AssertReaderHeld();
1589
1581
  }
1590
- } else { // normal case
1582
+ } else { // normal case
1591
1583
  ABSL_RAW_CHECK(this->AwaitCommon(cond, KernelTimeout::Never()),
1592
1584
  "condition untrue on return from Await");
1593
1585
  }
1594
1586
  }
1595
1587
 
1596
- bool Mutex::AwaitWithTimeout(const Condition &cond, absl::Duration timeout) {
1597
- return AwaitWithDeadline(cond, DeadlineFromTimeout(timeout));
1588
+ bool Mutex::AwaitWithTimeout(const Condition& cond, absl::Duration timeout) {
1589
+ if (cond.Eval()) { // condition already true; nothing to do
1590
+ if (kDebugMode) {
1591
+ this->AssertReaderHeld();
1592
+ }
1593
+ return true;
1594
+ }
1595
+
1596
+ KernelTimeout t{timeout};
1597
+ bool res = this->AwaitCommon(cond, t);
1598
+ ABSL_RAW_CHECK(res || t.has_timeout(),
1599
+ "condition untrue on return from Await");
1600
+ return res;
1598
1601
  }
1599
1602
 
1600
- bool Mutex::AwaitWithDeadline(const Condition &cond, absl::Time deadline) {
1601
- if (cond.Eval()) { // condition already true; nothing to do
1603
+ bool Mutex::AwaitWithDeadline(const Condition& cond, absl::Time deadline) {
1604
+ if (cond.Eval()) { // condition already true; nothing to do
1602
1605
  if (kDebugMode) {
1603
1606
  this->AssertReaderHeld();
1604
1607
  }
@@ -1612,14 +1615,14 @@ bool Mutex::AwaitWithDeadline(const Condition &cond, absl::Time deadline) {
1612
1615
  return res;
1613
1616
  }
1614
1617
 
1615
- bool Mutex::AwaitCommon(const Condition &cond, KernelTimeout t) {
1618
+ bool Mutex::AwaitCommon(const Condition& cond, KernelTimeout t) {
1616
1619
  this->AssertReaderHeld();
1617
1620
  MuHow how =
1618
1621
  (mu_.load(std::memory_order_relaxed) & kMuWriter) ? kExclusive : kShared;
1619
1622
  ABSL_TSAN_MUTEX_PRE_UNLOCK(this, TsanFlags(how));
1620
- SynchWaitParams waitp(
1621
- how, &cond, t, nullptr /*no cvmu*/, Synch_GetPerThreadAnnotated(this),
1622
- nullptr /*no cv_word*/);
1623
+ SynchWaitParams waitp(how, &cond, t, nullptr /*no cvmu*/,
1624
+ Synch_GetPerThreadAnnotated(this),
1625
+ nullptr /*no cv_word*/);
1623
1626
  int flags = kMuHasBlocked;
1624
1627
  if (!Condition::GuaranteedEqual(&cond, nullptr)) {
1625
1628
  flags |= kMuIsCond;
@@ -1639,14 +1642,13 @@ bool Mutex::TryLock() {
1639
1642
  ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock);
1640
1643
  intptr_t v = mu_.load(std::memory_order_relaxed);
1641
1644
  if ((v & (kMuWriter | kMuReader | kMuEvent)) == 0 && // try fast acquire
1642
- mu_.compare_exchange_strong(v, kMuWriter | v,
1643
- std::memory_order_acquire,
1645
+ mu_.compare_exchange_strong(v, kMuWriter | v, std::memory_order_acquire,
1644
1646
  std::memory_order_relaxed)) {
1645
1647
  DebugOnlyLockEnter(this);
1646
1648
  ABSL_TSAN_MUTEX_POST_LOCK(this, __tsan_mutex_try_lock, 0);
1647
1649
  return true;
1648
1650
  }
1649
- if ((v & kMuEvent) != 0) { // we're recording events
1651
+ if ((v & kMuEvent) != 0) { // we're recording events
1650
1652
  if ((v & kExclusive->slow_need_zero) == 0 && // try fast acquire
1651
1653
  mu_.compare_exchange_strong(
1652
1654
  v, (kExclusive->fast_or | v) + kExclusive->fast_add,
@@ -1672,7 +1674,7 @@ bool Mutex::ReaderTryLock() {
1672
1674
  // changing (typically because the reader count changes) under the CAS. We
1673
1675
  // limit the number of attempts to avoid having to think about livelock.
1674
1676
  int loop_limit = 5;
1675
- while ((v & (kMuWriter|kMuWait|kMuEvent)) == 0 && loop_limit != 0) {
1677
+ while ((v & (kMuWriter | kMuWait | kMuEvent)) == 0 && loop_limit != 0) {
1676
1678
  if (mu_.compare_exchange_strong(v, (kMuReader | v) + kMuOne,
1677
1679
  std::memory_order_acquire,
1678
1680
  std::memory_order_relaxed)) {
@@ -1684,7 +1686,7 @@ bool Mutex::ReaderTryLock() {
1684
1686
  loop_limit--;
1685
1687
  v = mu_.load(std::memory_order_relaxed);
1686
1688
  }
1687
- if ((v & kMuEvent) != 0) { // we're recording events
1689
+ if ((v & kMuEvent) != 0) { // we're recording events
1688
1690
  loop_limit = 5;
1689
1691
  while ((v & kShared->slow_need_zero) == 0 && loop_limit != 0) {
1690
1692
  if (mu_.compare_exchange_strong(v, (kMuReader | v) + kMuOne,
@@ -1723,7 +1725,7 @@ void Mutex::Unlock() {
1723
1725
  // should_try_cas is whether we'll try a compare-and-swap immediately.
1724
1726
  // NOTE: optimized out when kDebugMode is false.
1725
1727
  bool should_try_cas = ((v & (kMuEvent | kMuWriter)) == kMuWriter &&
1726
- (v & (kMuWait | kMuDesig)) != kMuWait);
1728
+ (v & (kMuWait | kMuDesig)) != kMuWait);
1727
1729
  // But, we can use an alternate computation of it, that compilers
1728
1730
  // currently don't find on their own. When that changes, this function
1729
1731
  // can be simplified.
@@ -1740,10 +1742,9 @@ void Mutex::Unlock() {
1740
1742
  static_cast<long long>(v), static_cast<long long>(x),
1741
1743
  static_cast<long long>(y));
1742
1744
  }
1743
- if (x < y &&
1744
- mu_.compare_exchange_strong(v, v & ~(kMuWrWait | kMuWriter),
1745
- std::memory_order_release,
1746
- std::memory_order_relaxed)) {
1745
+ if (x < y && mu_.compare_exchange_strong(v, v & ~(kMuWrWait | kMuWriter),
1746
+ std::memory_order_release,
1747
+ std::memory_order_relaxed)) {
1747
1748
  // fast writer release (writer with no waiters or with designated waker)
1748
1749
  } else {
1749
1750
  this->UnlockSlow(nullptr /*no waitp*/); // take slow path
@@ -1753,7 +1754,7 @@ void Mutex::Unlock() {
1753
1754
 
1754
1755
  // Requires v to represent a reader-locked state.
1755
1756
  static bool ExactlyOneReader(intptr_t v) {
1756
- assert((v & (kMuWriter|kMuReader)) == kMuReader);
1757
+ assert((v & (kMuWriter | kMuReader)) == kMuReader);
1757
1758
  assert((v & kMuHigh) != 0);
1758
1759
  // The more straightforward "(v & kMuHigh) == kMuOne" also works, but
1759
1760
  // on some architectures the following generates slightly smaller code.
@@ -1766,12 +1767,11 @@ void Mutex::ReaderUnlock() {
1766
1767
  ABSL_TSAN_MUTEX_PRE_UNLOCK(this, __tsan_mutex_read_lock);
1767
1768
  DebugOnlyLockLeave(this);
1768
1769
  intptr_t v = mu_.load(std::memory_order_relaxed);
1769
- assert((v & (kMuWriter|kMuReader)) == kMuReader);
1770
- if ((v & (kMuReader|kMuWait|kMuEvent)) == kMuReader) {
1770
+ assert((v & (kMuWriter | kMuReader)) == kMuReader);
1771
+ if ((v & (kMuReader | kMuWait | kMuEvent)) == kMuReader) {
1771
1772
  // fast reader release (reader with no waiters)
1772
- intptr_t clear = ExactlyOneReader(v) ? kMuReader|kMuOne : kMuOne;
1773
- if (mu_.compare_exchange_strong(v, v - clear,
1774
- std::memory_order_release,
1773
+ intptr_t clear = ExactlyOneReader(v) ? kMuReader | kMuOne : kMuOne;
1774
+ if (mu_.compare_exchange_strong(v, v - clear, std::memory_order_release,
1775
1775
  std::memory_order_relaxed)) {
1776
1776
  ABSL_TSAN_MUTEX_POST_UNLOCK(this, __tsan_mutex_read_lock);
1777
1777
  return;
@@ -1810,7 +1810,7 @@ static intptr_t IgnoreWaitingWritersMask(int flag) {
1810
1810
  }
1811
1811
 
1812
1812
  // Internal version of LockWhen(). See LockSlowWithDeadline()
1813
- ABSL_ATTRIBUTE_NOINLINE void Mutex::LockSlow(MuHow how, const Condition *cond,
1813
+ ABSL_ATTRIBUTE_NOINLINE void Mutex::LockSlow(MuHow how, const Condition* cond,
1814
1814
  int flags) {
1815
1815
  ABSL_RAW_CHECK(
1816
1816
  this->LockSlowWithDeadline(how, cond, KernelTimeout::Never(), flags),
@@ -1818,7 +1818,7 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::LockSlow(MuHow how, const Condition *cond,
1818
1818
  }
1819
1819
 
1820
1820
  // Compute cond->Eval() and tell race detectors that we do it under mutex mu.
1821
- static inline bool EvalConditionAnnotated(const Condition *cond, Mutex *mu,
1821
+ static inline bool EvalConditionAnnotated(const Condition* cond, Mutex* mu,
1822
1822
  bool locking, bool trylock,
1823
1823
  bool read_lock) {
1824
1824
  // Delicate annotation dance.
@@ -1868,7 +1868,7 @@ static inline bool EvalConditionAnnotated(const Condition *cond, Mutex *mu,
1868
1868
  // tsan). As the result there is no tsan-visible synchronization between the
1869
1869
  // addition and this thread. So if we would enable race detection here,
1870
1870
  // it would race with the predicate initialization.
1871
- static inline bool EvalConditionIgnored(Mutex *mu, const Condition *cond) {
1871
+ static inline bool EvalConditionIgnored(Mutex* mu, const Condition* cond) {
1872
1872
  // Memory accesses are already ignored inside of lock/unlock operations,
1873
1873
  // but synchronization operations are also ignored. When we evaluate the
1874
1874
  // predicate we must ignore only memory accesses but not synchronization,
@@ -1893,7 +1893,7 @@ static inline bool EvalConditionIgnored(Mutex *mu, const Condition *cond) {
1893
1893
  // obstruct this call
1894
1894
  // - kMuIsCond indicates that this is a conditional acquire (condition variable,
1895
1895
  // Await, LockWhen) so contention profiling should be suppressed.
1896
- bool Mutex::LockSlowWithDeadline(MuHow how, const Condition *cond,
1896
+ bool Mutex::LockSlowWithDeadline(MuHow how, const Condition* cond,
1897
1897
  KernelTimeout t, int flags) {
1898
1898
  intptr_t v = mu_.load(std::memory_order_relaxed);
1899
1899
  bool unlock = false;
@@ -1910,9 +1910,9 @@ bool Mutex::LockSlowWithDeadline(MuHow how, const Condition *cond,
1910
1910
  }
1911
1911
  unlock = true;
1912
1912
  }
1913
- SynchWaitParams waitp(
1914
- how, cond, t, nullptr /*no cvmu*/, Synch_GetPerThreadAnnotated(this),
1915
- nullptr /*no cv_word*/);
1913
+ SynchWaitParams waitp(how, cond, t, nullptr /*no cvmu*/,
1914
+ Synch_GetPerThreadAnnotated(this),
1915
+ nullptr /*no cv_word*/);
1916
1916
  if (!Condition::GuaranteedEqual(cond, nullptr)) {
1917
1917
  flags |= kMuIsCond;
1918
1918
  }
@@ -1953,20 +1953,20 @@ static void CheckForMutexCorruption(intptr_t v, const char* label) {
1953
1953
  if (ABSL_PREDICT_TRUE((w & (w << 3) & (kMuWriter | kMuWrWait)) == 0)) return;
1954
1954
  RAW_CHECK_FMT((v & (kMuWriter | kMuReader)) != (kMuWriter | kMuReader),
1955
1955
  "%s: Mutex corrupt: both reader and writer lock held: %p",
1956
- label, reinterpret_cast<void *>(v));
1956
+ label, reinterpret_cast<void*>(v));
1957
1957
  RAW_CHECK_FMT((v & (kMuWait | kMuWrWait)) != kMuWrWait,
1958
- "%s: Mutex corrupt: waiting writer with no waiters: %p",
1959
- label, reinterpret_cast<void *>(v));
1958
+ "%s: Mutex corrupt: waiting writer with no waiters: %p", label,
1959
+ reinterpret_cast<void*>(v));
1960
1960
  assert(false);
1961
1961
  }
1962
1962
 
1963
- void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
1963
+ void Mutex::LockSlowLoop(SynchWaitParams* waitp, int flags) {
1964
1964
  SchedulingGuard::ScopedDisable disable_rescheduling;
1965
1965
  int c = 0;
1966
1966
  intptr_t v = mu_.load(std::memory_order_relaxed);
1967
1967
  if ((v & kMuEvent) != 0) {
1968
- PostSynchEvent(this,
1969
- waitp->how == kExclusive? SYNCH_EV_LOCK: SYNCH_EV_READERLOCK);
1968
+ PostSynchEvent(
1969
+ this, waitp->how == kExclusive ? SYNCH_EV_LOCK : SYNCH_EV_READERLOCK);
1970
1970
  }
1971
1971
  ABSL_RAW_CHECK(
1972
1972
  waitp->thread->waitp == nullptr || waitp->thread->suppress_fatal_errors,
@@ -1991,11 +1991,11 @@ void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
1991
1991
  flags |= kMuHasBlocked;
1992
1992
  c = 0;
1993
1993
  }
1994
- } else { // need to access waiter list
1994
+ } else { // need to access waiter list
1995
1995
  bool dowait = false;
1996
- if ((v & (kMuSpin|kMuWait)) == 0) { // no waiters
1996
+ if ((v & (kMuSpin | kMuWait)) == 0) { // no waiters
1997
1997
  // This thread tries to become the one and only waiter.
1998
- PerThreadSynch *new_h = Enqueue(nullptr, waitp, v, flags);
1998
+ PerThreadSynch* new_h = Enqueue(nullptr, waitp, v, flags);
1999
1999
  intptr_t nv =
2000
2000
  (v & ClearDesignatedWakerMask(flags & kMuHasBlocked) & kMuLow) |
2001
2001
  kMuWait;
@@ -2007,7 +2007,7 @@ void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
2007
2007
  v, reinterpret_cast<intptr_t>(new_h) | nv,
2008
2008
  std::memory_order_release, std::memory_order_relaxed)) {
2009
2009
  dowait = true;
2010
- } else { // attempted Enqueue() failed
2010
+ } else { // attempted Enqueue() failed
2011
2011
  // zero out the waitp field set by Enqueue()
2012
2012
  waitp->thread->waitp = nullptr;
2013
2013
  }
@@ -2020,9 +2020,9 @@ void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
2020
2020
  (v & ClearDesignatedWakerMask(flags & kMuHasBlocked)) |
2021
2021
  kMuSpin | kMuReader,
2022
2022
  std::memory_order_acquire, std::memory_order_relaxed)) {
2023
- PerThreadSynch *h = GetPerThreadSynch(v);
2024
- h->readers += kMuOne; // inc reader count in waiter
2025
- do { // release spinlock
2023
+ PerThreadSynch* h = GetPerThreadSynch(v);
2024
+ h->readers += kMuOne; // inc reader count in waiter
2025
+ do { // release spinlock
2026
2026
  v = mu_.load(std::memory_order_relaxed);
2027
2027
  } while (!mu_.compare_exchange_weak(v, (v & ~kMuSpin) | kMuReader,
2028
2028
  std::memory_order_release,
@@ -2032,7 +2032,7 @@ void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
2032
2032
  waitp->how == kShared)) {
2033
2033
  break; // we timed out, or condition true, so return
2034
2034
  }
2035
- this->UnlockSlow(waitp); // got lock but condition false
2035
+ this->UnlockSlow(waitp); // got lock but condition false
2036
2036
  this->Block(waitp->thread);
2037
2037
  flags |= kMuHasBlocked;
2038
2038
  c = 0;
@@ -2043,18 +2043,19 @@ void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
2043
2043
  (v & ClearDesignatedWakerMask(flags & kMuHasBlocked)) |
2044
2044
  kMuSpin | kMuWait,
2045
2045
  std::memory_order_acquire, std::memory_order_relaxed)) {
2046
- PerThreadSynch *h = GetPerThreadSynch(v);
2047
- PerThreadSynch *new_h = Enqueue(h, waitp, v, flags);
2046
+ PerThreadSynch* h = GetPerThreadSynch(v);
2047
+ PerThreadSynch* new_h = Enqueue(h, waitp, v, flags);
2048
2048
  intptr_t wr_wait = 0;
2049
2049
  ABSL_RAW_CHECK(new_h != nullptr, "Enqueue to list failed");
2050
2050
  if (waitp->how == kExclusive && (v & kMuReader) != 0) {
2051
- wr_wait = kMuWrWait; // give priority to a waiting writer
2051
+ wr_wait = kMuWrWait; // give priority to a waiting writer
2052
2052
  }
2053
- do { // release spinlock
2053
+ do { // release spinlock
2054
2054
  v = mu_.load(std::memory_order_relaxed);
2055
2055
  } while (!mu_.compare_exchange_weak(
2056
- v, (v & (kMuLow & ~kMuSpin)) | kMuWait | wr_wait |
2057
- reinterpret_cast<intptr_t>(new_h),
2056
+ v,
2057
+ (v & (kMuLow & ~kMuSpin)) | kMuWait | wr_wait |
2058
+ reinterpret_cast<intptr_t>(new_h),
2058
2059
  std::memory_order_release, std::memory_order_relaxed));
2059
2060
  dowait = true;
2060
2061
  }
@@ -2074,9 +2075,9 @@ void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
2074
2075
  waitp->thread->waitp == nullptr || waitp->thread->suppress_fatal_errors,
2075
2076
  "detected illegal recursion into Mutex code");
2076
2077
  if ((v & kMuEvent) != 0) {
2077
- PostSynchEvent(this,
2078
- waitp->how == kExclusive? SYNCH_EV_LOCK_RETURNING :
2079
- SYNCH_EV_READERLOCK_RETURNING);
2078
+ PostSynchEvent(this, waitp->how == kExclusive
2079
+ ? SYNCH_EV_LOCK_RETURNING
2080
+ : SYNCH_EV_READERLOCK_RETURNING);
2080
2081
  }
2081
2082
  }
2082
2083
 
@@ -2085,28 +2086,28 @@ void Mutex::LockSlowLoop(SynchWaitParams *waitp, int flags) {
2085
2086
  // which holds the lock but is not runnable because its condition is false
2086
2087
  // or it is in the process of blocking on a condition variable; it must requeue
2087
2088
  // itself on the mutex/condvar to wait for its condition to become true.
2088
- ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2089
+ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams* waitp) {
2089
2090
  SchedulingGuard::ScopedDisable disable_rescheduling;
2090
2091
  intptr_t v = mu_.load(std::memory_order_relaxed);
2091
2092
  this->AssertReaderHeld();
2092
2093
  CheckForMutexCorruption(v, "Unlock");
2093
2094
  if ((v & kMuEvent) != 0) {
2094
- PostSynchEvent(this,
2095
- (v & kMuWriter) != 0? SYNCH_EV_UNLOCK: SYNCH_EV_READERUNLOCK);
2095
+ PostSynchEvent(
2096
+ this, (v & kMuWriter) != 0 ? SYNCH_EV_UNLOCK : SYNCH_EV_READERUNLOCK);
2096
2097
  }
2097
2098
  int c = 0;
2098
2099
  // the waiter under consideration to wake, or zero
2099
- PerThreadSynch *w = nullptr;
2100
+ PerThreadSynch* w = nullptr;
2100
2101
  // the predecessor to w or zero
2101
- PerThreadSynch *pw = nullptr;
2102
+ PerThreadSynch* pw = nullptr;
2102
2103
  // head of the list searched previously, or zero
2103
- PerThreadSynch *old_h = nullptr;
2104
+ PerThreadSynch* old_h = nullptr;
2104
2105
  // a condition that's known to be false.
2105
- const Condition *known_false = nullptr;
2106
- PerThreadSynch *wake_list = kPerThreadSynchNull; // list of threads to wake
2107
- intptr_t wr_wait = 0; // set to kMuWrWait if we wake a reader and a
2108
- // later writer could have acquired the lock
2109
- // (starvation avoidance)
2106
+ const Condition* known_false = nullptr;
2107
+ PerThreadSynch* wake_list = kPerThreadSynchNull; // list of threads to wake
2108
+ intptr_t wr_wait = 0; // set to kMuWrWait if we wake a reader and a
2109
+ // later writer could have acquired the lock
2110
+ // (starvation avoidance)
2110
2111
  ABSL_RAW_CHECK(waitp == nullptr || waitp->thread->waitp == nullptr ||
2111
2112
  waitp->thread->suppress_fatal_errors,
2112
2113
  "detected illegal recursion into Mutex code");
@@ -2126,8 +2127,7 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2126
2127
  } else if ((v & (kMuReader | kMuWait)) == kMuReader && waitp == nullptr) {
2127
2128
  // fast reader release (reader with no waiters)
2128
2129
  intptr_t clear = ExactlyOneReader(v) ? kMuReader | kMuOne : kMuOne;
2129
- if (mu_.compare_exchange_strong(v, v - clear,
2130
- std::memory_order_release,
2130
+ if (mu_.compare_exchange_strong(v, v - clear, std::memory_order_release,
2131
2131
  std::memory_order_relaxed)) {
2132
2132
  return;
2133
2133
  }
@@ -2135,16 +2135,16 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2135
2135
  mu_.compare_exchange_strong(v, v | kMuSpin,
2136
2136
  std::memory_order_acquire,
2137
2137
  std::memory_order_relaxed)) {
2138
- if ((v & kMuWait) == 0) { // no one to wake
2138
+ if ((v & kMuWait) == 0) { // no one to wake
2139
2139
  intptr_t nv;
2140
2140
  bool do_enqueue = true; // always Enqueue() the first time
2141
2141
  ABSL_RAW_CHECK(waitp != nullptr,
2142
2142
  "UnlockSlow is confused"); // about to sleep
2143
- do { // must loop to release spinlock as reader count may change
2143
+ do { // must loop to release spinlock as reader count may change
2144
2144
  v = mu_.load(std::memory_order_relaxed);
2145
2145
  // decrement reader count if there are readers
2146
- intptr_t new_readers = (v >= kMuOne)? v - kMuOne : v;
2147
- PerThreadSynch *new_h = nullptr;
2146
+ intptr_t new_readers = (v >= kMuOne) ? v - kMuOne : v;
2147
+ PerThreadSynch* new_h = nullptr;
2148
2148
  if (do_enqueue) {
2149
2149
  // If we are enqueuing on a CondVar (waitp->cv_word != nullptr) then
2150
2150
  // we must not retry here. The initial attempt will always have
@@ -2168,21 +2168,20 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2168
2168
  }
2169
2169
  // release spinlock & our lock; retry if reader-count changed
2170
2170
  // (writer count cannot change since we hold lock)
2171
- } while (!mu_.compare_exchange_weak(v, nv,
2172
- std::memory_order_release,
2171
+ } while (!mu_.compare_exchange_weak(v, nv, std::memory_order_release,
2173
2172
  std::memory_order_relaxed));
2174
2173
  break;
2175
2174
  }
2176
2175
 
2177
2176
  // There are waiters.
2178
2177
  // Set h to the head of the circular waiter list.
2179
- PerThreadSynch *h = GetPerThreadSynch(v);
2178
+ PerThreadSynch* h = GetPerThreadSynch(v);
2180
2179
  if ((v & kMuReader) != 0 && (h->readers & kMuHigh) > kMuOne) {
2181
2180
  // a reader but not the last
2182
- h->readers -= kMuOne; // release our lock
2183
- intptr_t nv = v; // normally just release spinlock
2181
+ h->readers -= kMuOne; // release our lock
2182
+ intptr_t nv = v; // normally just release spinlock
2184
2183
  if (waitp != nullptr) { // but waitp!=nullptr => must queue ourselves
2185
- PerThreadSynch *new_h = Enqueue(h, waitp, v, kMuIsCond);
2184
+ PerThreadSynch* new_h = Enqueue(h, waitp, v, kMuIsCond);
2186
2185
  ABSL_RAW_CHECK(new_h != nullptr,
2187
2186
  "waiters disappeared during Enqueue()!");
2188
2187
  nv &= kMuLow;
@@ -2200,8 +2199,8 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2200
2199
 
2201
2200
  // The lock is becoming free, and there's a waiter
2202
2201
  if (old_h != nullptr &&
2203
- !old_h->may_skip) { // we used old_h as a terminator
2204
- old_h->may_skip = true; // allow old_h to skip once more
2202
+ !old_h->may_skip) { // we used old_h as a terminator
2203
+ old_h->may_skip = true; // allow old_h to skip once more
2205
2204
  ABSL_RAW_CHECK(old_h->skip == nullptr, "illegal skip from head");
2206
2205
  if (h != old_h && MuEquivalentWaiter(old_h, old_h->next)) {
2207
2206
  old_h->skip = old_h->next; // old_h not head & can skip to successor
@@ -2210,7 +2209,7 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2210
2209
  if (h->next->waitp->how == kExclusive &&
2211
2210
  Condition::GuaranteedEqual(h->next->waitp->cond, nullptr)) {
2212
2211
  // easy case: writer with no condition; no need to search
2213
- pw = h; // wake w, the successor of h (=pw)
2212
+ pw = h; // wake w, the successor of h (=pw)
2214
2213
  w = h->next;
2215
2214
  w->wake = true;
2216
2215
  // We are waking up a writer. This writer may be racing against
@@ -2233,13 +2232,13 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2233
2232
  // waiter has a condition or is a reader. We avoid searching over
2234
2233
  // waiters we've searched on previous iterations by starting at
2235
2234
  // old_h if it's set. If old_h==h, there's no one to wakeup at all.
2236
- if (old_h == h) { // we've searched before, and nothing's new
2237
- // so there's no one to wake.
2238
- intptr_t nv = (v & ~(kMuReader|kMuWriter|kMuWrWait));
2235
+ if (old_h == h) { // we've searched before, and nothing's new
2236
+ // so there's no one to wake.
2237
+ intptr_t nv = (v & ~(kMuReader | kMuWriter | kMuWrWait));
2239
2238
  h->readers = 0;
2240
- h->maybe_unlocking = false; // finished unlocking
2241
- if (waitp != nullptr) { // we must queue ourselves and sleep
2242
- PerThreadSynch *new_h = Enqueue(h, waitp, v, kMuIsCond);
2239
+ h->maybe_unlocking = false; // finished unlocking
2240
+ if (waitp != nullptr) { // we must queue ourselves and sleep
2241
+ PerThreadSynch* new_h = Enqueue(h, waitp, v, kMuIsCond);
2243
2242
  nv &= kMuLow;
2244
2243
  if (new_h != nullptr) {
2245
2244
  nv |= kMuWait | reinterpret_cast<intptr_t>(new_h);
@@ -2253,12 +2252,12 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2253
2252
  }
2254
2253
 
2255
2254
  // set up to walk the list
2256
- PerThreadSynch *w_walk; // current waiter during list walk
2257
- PerThreadSynch *pw_walk; // previous waiter during list walk
2255
+ PerThreadSynch* w_walk; // current waiter during list walk
2256
+ PerThreadSynch* pw_walk; // previous waiter during list walk
2258
2257
  if (old_h != nullptr) { // we've searched up to old_h before
2259
2258
  pw_walk = old_h;
2260
2259
  w_walk = old_h->next;
2261
- } else { // no prior search, start at beginning
2260
+ } else { // no prior search, start at beginning
2262
2261
  pw_walk =
2263
2262
  nullptr; // h->next's predecessor may change; don't record it
2264
2263
  w_walk = h->next;
@@ -2284,7 +2283,7 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2284
2283
  // to walk the path from w_walk to h inclusive. (TryRemove() can remove
2285
2284
  // a waiter anywhere, but it acquires both the spinlock and the Mutex)
2286
2285
 
2287
- old_h = h; // remember we searched to here
2286
+ old_h = h; // remember we searched to here
2288
2287
 
2289
2288
  // Walk the path upto and including h looking for waiters we can wake.
2290
2289
  while (pw_walk != h) {
@@ -2296,24 +2295,24 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2296
2295
  // is in fact true
2297
2296
  EvalConditionIgnored(this, w_walk->waitp->cond))) {
2298
2297
  if (w == nullptr) {
2299
- w_walk->wake = true; // can wake this waiter
2298
+ w_walk->wake = true; // can wake this waiter
2300
2299
  w = w_walk;
2301
2300
  pw = pw_walk;
2302
2301
  if (w_walk->waitp->how == kExclusive) {
2303
2302
  wr_wait = kMuWrWait;
2304
- break; // bail if waking this writer
2303
+ break; // bail if waking this writer
2305
2304
  }
2306
2305
  } else if (w_walk->waitp->how == kShared) { // wake if a reader
2307
2306
  w_walk->wake = true;
2308
- } else { // writer with true condition
2307
+ } else { // writer with true condition
2309
2308
  wr_wait = kMuWrWait;
2310
2309
  }
2311
- } else { // can't wake; condition false
2310
+ } else { // can't wake; condition false
2312
2311
  known_false = w_walk->waitp->cond; // remember last false condition
2313
2312
  }
2314
- if (w_walk->wake) { // we're waking reader w_walk
2315
- pw_walk = w_walk; // don't skip similar waiters
2316
- } else { // not waking; skip as much as possible
2313
+ if (w_walk->wake) { // we're waking reader w_walk
2314
+ pw_walk = w_walk; // don't skip similar waiters
2315
+ } else { // not waking; skip as much as possible
2317
2316
  pw_walk = Skip(w_walk);
2318
2317
  }
2319
2318
  // If pw_walk == h, then load of pw_walk->next can race with
@@ -2340,8 +2339,8 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2340
2339
  h = DequeueAllWakeable(h, pw, &wake_list);
2341
2340
 
2342
2341
  intptr_t nv = (v & kMuEvent) | kMuDesig;
2343
- // assume no waiters left,
2344
- // set kMuDesig for INV1a
2342
+ // assume no waiters left,
2343
+ // set kMuDesig for INV1a
2345
2344
 
2346
2345
  if (waitp != nullptr) { // we must queue ourselves and sleep
2347
2346
  h = Enqueue(h, waitp, v, kMuIsCond);
@@ -2354,7 +2353,7 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2354
2353
 
2355
2354
  if (h != nullptr) { // there are waiters left
2356
2355
  h->readers = 0;
2357
- h->maybe_unlocking = false; // finished unlocking
2356
+ h->maybe_unlocking = false; // finished unlocking
2358
2357
  nv |= wr_wait | kMuWait | reinterpret_cast<intptr_t>(h);
2359
2358
  }
2360
2359
 
@@ -2365,12 +2364,12 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2365
2364
  }
2366
2365
  // aggressive here; no one can proceed till we do
2367
2366
  c = synchronization_internal::MutexDelay(c, AGGRESSIVE);
2368
- } // end of for(;;)-loop
2367
+ } // end of for(;;)-loop
2369
2368
 
2370
2369
  if (wake_list != kPerThreadSynchNull) {
2371
2370
  int64_t total_wait_cycles = 0;
2372
2371
  int64_t max_wait_cycles = 0;
2373
- int64_t now = base_internal::CycleClock::Now();
2372
+ int64_t now = CycleClock::Now();
2374
2373
  do {
2375
2374
  // Profile lock contention events only if the waiter was trying to acquire
2376
2375
  // the lock, not waiting on a condition variable or Condition.
@@ -2382,7 +2381,7 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
2382
2381
  wake_list->waitp->contention_start_cycles = now;
2383
2382
  wake_list->waitp->should_submit_contention_data = true;
2384
2383
  }
2385
- wake_list = Wakeup(wake_list); // wake waiters
2384
+ wake_list = Wakeup(wake_list); // wake waiters
2386
2385
  } while (wake_list != kPerThreadSynchNull);
2387
2386
  if (total_wait_cycles > 0) {
2388
2387
  mutex_tracer("slow release", this, total_wait_cycles);
@@ -2410,7 +2409,7 @@ void Mutex::Trans(MuHow how) {
2410
2409
  // condition variable. If this mutex is free, we simply wake the thread.
2411
2410
  // It will later acquire the mutex with high probability. Otherwise, we
2412
2411
  // enqueue thread w on this mutex.
2413
- void Mutex::Fer(PerThreadSynch *w) {
2412
+ void Mutex::Fer(PerThreadSynch* w) {
2414
2413
  SchedulingGuard::ScopedDisable disable_rescheduling;
2415
2414
  int c = 0;
2416
2415
  ABSL_RAW_CHECK(w->waitp->cond == nullptr,
@@ -2435,9 +2434,9 @@ void Mutex::Fer(PerThreadSynch *w) {
2435
2434
  IncrementSynchSem(this, w);
2436
2435
  return;
2437
2436
  } else {
2438
- if ((v & (kMuSpin|kMuWait)) == 0) { // no waiters
2437
+ if ((v & (kMuSpin | kMuWait)) == 0) { // no waiters
2439
2438
  // This thread tries to become the one and only waiter.
2440
- PerThreadSynch *new_h = Enqueue(nullptr, w->waitp, v, kMuIsCond);
2439
+ PerThreadSynch* new_h = Enqueue(nullptr, w->waitp, v, kMuIsCond);
2441
2440
  ABSL_RAW_CHECK(new_h != nullptr,
2442
2441
  "Enqueue failed"); // we must queue ourselves
2443
2442
  if (mu_.compare_exchange_strong(
@@ -2447,8 +2446,8 @@ void Mutex::Fer(PerThreadSynch *w) {
2447
2446
  }
2448
2447
  } else if ((v & kMuSpin) == 0 &&
2449
2448
  mu_.compare_exchange_strong(v, v | kMuSpin | kMuWait)) {
2450
- PerThreadSynch *h = GetPerThreadSynch(v);
2451
- PerThreadSynch *new_h = Enqueue(h, w->waitp, v, kMuIsCond);
2449
+ PerThreadSynch* h = GetPerThreadSynch(v);
2450
+ PerThreadSynch* new_h = Enqueue(h, w->waitp, v, kMuIsCond);
2452
2451
  ABSL_RAW_CHECK(new_h != nullptr,
2453
2452
  "Enqueue failed"); // we must queue ourselves
2454
2453
  do {
@@ -2467,19 +2466,18 @@ void Mutex::Fer(PerThreadSynch *w) {
2467
2466
 
2468
2467
  void Mutex::AssertHeld() const {
2469
2468
  if ((mu_.load(std::memory_order_relaxed) & kMuWriter) == 0) {
2470
- SynchEvent *e = GetSynchEvent(this);
2469
+ SynchEvent* e = GetSynchEvent(this);
2471
2470
  ABSL_RAW_LOG(FATAL, "thread should hold write lock on Mutex %p %s",
2472
- static_cast<const void *>(this),
2473
- (e == nullptr ? "" : e->name));
2471
+ static_cast<const void*>(this), (e == nullptr ? "" : e->name));
2474
2472
  }
2475
2473
  }
2476
2474
 
2477
2475
  void Mutex::AssertReaderHeld() const {
2478
2476
  if ((mu_.load(std::memory_order_relaxed) & (kMuReader | kMuWriter)) == 0) {
2479
- SynchEvent *e = GetSynchEvent(this);
2480
- ABSL_RAW_LOG(
2481
- FATAL, "thread should hold at least a read lock on Mutex %p %s",
2482
- static_cast<const void *>(this), (e == nullptr ? "" : e->name));
2477
+ SynchEvent* e = GetSynchEvent(this);
2478
+ ABSL_RAW_LOG(FATAL,
2479
+ "thread should hold at least a read lock on Mutex %p %s",
2480
+ static_cast<const void*>(this), (e == nullptr ? "" : e->name));
2483
2481
  }
2484
2482
  }
2485
2483
 
@@ -2490,13 +2488,17 @@ static const intptr_t kCvEvent = 0x0002L; // record events
2490
2488
  static const intptr_t kCvLow = 0x0003L; // low order bits of CV
2491
2489
 
2492
2490
  // Hack to make constant values available to gdb pretty printer
2493
- enum { kGdbCvSpin = kCvSpin, kGdbCvEvent = kCvEvent, kGdbCvLow = kCvLow, };
2491
+ enum {
2492
+ kGdbCvSpin = kCvSpin,
2493
+ kGdbCvEvent = kCvEvent,
2494
+ kGdbCvLow = kCvLow,
2495
+ };
2494
2496
 
2495
2497
  static_assert(PerThreadSynch::kAlignment > kCvLow,
2496
2498
  "PerThreadSynch::kAlignment must be greater than kCvLow");
2497
2499
 
2498
- void CondVar::EnableDebugLog(const char *name) {
2499
- SynchEvent *e = EnsureSynchEvent(&this->cv_, name, kCvEvent, kCvSpin);
2500
+ void CondVar::EnableDebugLog(const char* name) {
2501
+ SynchEvent* e = EnsureSynchEvent(&this->cv_, name, kCvEvent, kCvSpin);
2500
2502
  e->log = true;
2501
2503
  UnrefSynchEvent(e);
2502
2504
  }
@@ -2507,25 +2509,23 @@ CondVar::~CondVar() {
2507
2509
  }
2508
2510
  }
2509
2511
 
2510
-
2511
2512
  // Remove thread s from the list of waiters on this condition variable.
2512
- void CondVar::Remove(PerThreadSynch *s) {
2513
+ void CondVar::Remove(PerThreadSynch* s) {
2513
2514
  SchedulingGuard::ScopedDisable disable_rescheduling;
2514
2515
  intptr_t v;
2515
2516
  int c = 0;
2516
2517
  for (v = cv_.load(std::memory_order_relaxed);;
2517
2518
  v = cv_.load(std::memory_order_relaxed)) {
2518
2519
  if ((v & kCvSpin) == 0 && // attempt to acquire spinlock
2519
- cv_.compare_exchange_strong(v, v | kCvSpin,
2520
- std::memory_order_acquire,
2520
+ cv_.compare_exchange_strong(v, v | kCvSpin, std::memory_order_acquire,
2521
2521
  std::memory_order_relaxed)) {
2522
- PerThreadSynch *h = reinterpret_cast<PerThreadSynch *>(v & ~kCvLow);
2522
+ PerThreadSynch* h = reinterpret_cast<PerThreadSynch*>(v & ~kCvLow);
2523
2523
  if (h != nullptr) {
2524
- PerThreadSynch *w = h;
2524
+ PerThreadSynch* w = h;
2525
2525
  while (w->next != s && w->next != h) { // search for thread
2526
2526
  w = w->next;
2527
2527
  }
2528
- if (w->next == s) { // found thread; remove it
2528
+ if (w->next == s) { // found thread; remove it
2529
2529
  w->next = s->next;
2530
2530
  if (h == s) {
2531
2531
  h = (w == s) ? nullptr : w;
@@ -2534,7 +2534,7 @@ void CondVar::Remove(PerThreadSynch *s) {
2534
2534
  s->state.store(PerThreadSynch::kAvailable, std::memory_order_release);
2535
2535
  }
2536
2536
  }
2537
- // release spinlock
2537
+ // release spinlock
2538
2538
  cv_.store((v & kCvEvent) | reinterpret_cast<intptr_t>(h),
2539
2539
  std::memory_order_release);
2540
2540
  return;
@@ -2557,14 +2557,14 @@ void CondVar::Remove(PerThreadSynch *s) {
2557
2557
  // variable queue just before the mutex is to be unlocked, and (most
2558
2558
  // importantly) after any call to an external routine that might re-enter the
2559
2559
  // mutex code.
2560
- static void CondVarEnqueue(SynchWaitParams *waitp) {
2560
+ static void CondVarEnqueue(SynchWaitParams* waitp) {
2561
2561
  // This thread might be transferred to the Mutex queue by Fer() when
2562
2562
  // we are woken. To make sure that is what happens, Enqueue() doesn't
2563
2563
  // call CondVarEnqueue() again but instead uses its normal code. We
2564
2564
  // must do this before we queue ourselves so that cv_word will be null
2565
2565
  // when seen by the dequeuer, who may wish immediately to requeue
2566
2566
  // this thread on another queue.
2567
- std::atomic<intptr_t> *cv_word = waitp->cv_word;
2567
+ std::atomic<intptr_t>* cv_word = waitp->cv_word;
2568
2568
  waitp->cv_word = nullptr;
2569
2569
 
2570
2570
  intptr_t v = cv_word->load(std::memory_order_relaxed);
@@ -2577,8 +2577,8 @@ static void CondVarEnqueue(SynchWaitParams *waitp) {
2577
2577
  v = cv_word->load(std::memory_order_relaxed);
2578
2578
  }
2579
2579
  ABSL_RAW_CHECK(waitp->thread->waitp == nullptr, "waiting when shouldn't be");
2580
- waitp->thread->waitp = waitp; // prepare ourselves for waiting
2581
- PerThreadSynch *h = reinterpret_cast<PerThreadSynch *>(v & ~kCvLow);
2580
+ waitp->thread->waitp = waitp; // prepare ourselves for waiting
2581
+ PerThreadSynch* h = reinterpret_cast<PerThreadSynch*>(v & ~kCvLow);
2582
2582
  if (h == nullptr) { // add this thread to waiter list
2583
2583
  waitp->thread->next = waitp->thread;
2584
2584
  } else {
@@ -2591,8 +2591,8 @@ static void CondVarEnqueue(SynchWaitParams *waitp) {
2591
2591
  std::memory_order_release);
2592
2592
  }
2593
2593
 
2594
- bool CondVar::WaitCommon(Mutex *mutex, KernelTimeout t) {
2595
- bool rc = false; // return value; true iff we timed-out
2594
+ bool CondVar::WaitCommon(Mutex* mutex, KernelTimeout t) {
2595
+ bool rc = false; // return value; true iff we timed-out
2596
2596
 
2597
2597
  intptr_t mutex_v = mutex->mu_.load(std::memory_order_relaxed);
2598
2598
  Mutex::MuHow mutex_how = ((mutex_v & kMuWriter) != 0) ? kExclusive : kShared;
@@ -2659,27 +2659,25 @@ bool CondVar::WaitCommon(Mutex *mutex, KernelTimeout t) {
2659
2659
  return rc;
2660
2660
  }
2661
2661
 
2662
- bool CondVar::WaitWithTimeout(Mutex *mu, absl::Duration timeout) {
2663
- return WaitWithDeadline(mu, DeadlineFromTimeout(timeout));
2662
+ bool CondVar::WaitWithTimeout(Mutex* mu, absl::Duration timeout) {
2663
+ return WaitCommon(mu, KernelTimeout(timeout));
2664
2664
  }
2665
2665
 
2666
- bool CondVar::WaitWithDeadline(Mutex *mu, absl::Time deadline) {
2666
+ bool CondVar::WaitWithDeadline(Mutex* mu, absl::Time deadline) {
2667
2667
  return WaitCommon(mu, KernelTimeout(deadline));
2668
2668
  }
2669
2669
 
2670
- void CondVar::Wait(Mutex *mu) {
2671
- WaitCommon(mu, KernelTimeout::Never());
2672
- }
2670
+ void CondVar::Wait(Mutex* mu) { WaitCommon(mu, KernelTimeout::Never()); }
2673
2671
 
2674
2672
  // Wake thread w
2675
2673
  // If it was a timed wait, w will be waiting on w->cv
2676
2674
  // Otherwise, if it was not a Mutex mutex, w will be waiting on w->sem
2677
2675
  // Otherwise, w is transferred to the Mutex mutex via Mutex::Fer().
2678
- void CondVar::Wakeup(PerThreadSynch *w) {
2676
+ void CondVar::Wakeup(PerThreadSynch* w) {
2679
2677
  if (w->waitp->timeout.has_timeout() || w->waitp->cvmu == nullptr) {
2680
2678
  // The waiting thread only needs to observe "w->state == kAvailable" to be
2681
2679
  // released, we must cache "cvmu" before clearing "next".
2682
- Mutex *mu = w->waitp->cvmu;
2680
+ Mutex* mu = w->waitp->cvmu;
2683
2681
  w->next = nullptr;
2684
2682
  w->state.store(PerThreadSynch::kAvailable, std::memory_order_release);
2685
2683
  Mutex::IncrementSynchSem(mu, w);
@@ -2696,11 +2694,10 @@ void CondVar::Signal() {
2696
2694
  for (v = cv_.load(std::memory_order_relaxed); v != 0;
2697
2695
  v = cv_.load(std::memory_order_relaxed)) {
2698
2696
  if ((v & kCvSpin) == 0 && // attempt to acquire spinlock
2699
- cv_.compare_exchange_strong(v, v | kCvSpin,
2700
- std::memory_order_acquire,
2697
+ cv_.compare_exchange_strong(v, v | kCvSpin, std::memory_order_acquire,
2701
2698
  std::memory_order_relaxed)) {
2702
- PerThreadSynch *h = reinterpret_cast<PerThreadSynch *>(v & ~kCvLow);
2703
- PerThreadSynch *w = nullptr;
2699
+ PerThreadSynch* h = reinterpret_cast<PerThreadSynch*>(v & ~kCvLow);
2700
+ PerThreadSynch* w = nullptr;
2704
2701
  if (h != nullptr) { // remove first waiter
2705
2702
  w = h->next;
2706
2703
  if (w == h) {
@@ -2709,11 +2706,11 @@ void CondVar::Signal() {
2709
2706
  h->next = w->next;
2710
2707
  }
2711
2708
  }
2712
- // release spinlock
2709
+ // release spinlock
2713
2710
  cv_.store((v & kCvEvent) | reinterpret_cast<intptr_t>(h),
2714
2711
  std::memory_order_release);
2715
2712
  if (w != nullptr) {
2716
- CondVar::Wakeup(w); // wake waiter, if there was one
2713
+ CondVar::Wakeup(w); // wake waiter, if there was one
2717
2714
  cond_var_tracer("Signal wakeup", this);
2718
2715
  }
2719
2716
  if ((v & kCvEvent) != 0) {
@@ -2728,7 +2725,7 @@ void CondVar::Signal() {
2728
2725
  ABSL_TSAN_MUTEX_POST_SIGNAL(nullptr, 0);
2729
2726
  }
2730
2727
 
2731
- void CondVar::SignalAll () {
2728
+ void CondVar::SignalAll() {
2732
2729
  ABSL_TSAN_MUTEX_PRE_SIGNAL(nullptr, 0);
2733
2730
  intptr_t v;
2734
2731
  int c = 0;
@@ -2742,11 +2739,11 @@ void CondVar::SignalAll () {
2742
2739
  if ((v & kCvSpin) == 0 &&
2743
2740
  cv_.compare_exchange_strong(v, v & kCvEvent, std::memory_order_acquire,
2744
2741
  std::memory_order_relaxed)) {
2745
- PerThreadSynch *h = reinterpret_cast<PerThreadSynch *>(v & ~kCvLow);
2742
+ PerThreadSynch* h = reinterpret_cast<PerThreadSynch*>(v & ~kCvLow);
2746
2743
  if (h != nullptr) {
2747
- PerThreadSynch *w;
2748
- PerThreadSynch *n = h->next;
2749
- do { // for every thread, wake it up
2744
+ PerThreadSynch* w;
2745
+ PerThreadSynch* n = h->next;
2746
+ do { // for every thread, wake it up
2750
2747
  w = n;
2751
2748
  n = n->next;
2752
2749
  CondVar::Wakeup(w);
@@ -2774,42 +2771,41 @@ void ReleasableMutexLock::Release() {
2774
2771
  }
2775
2772
 
2776
2773
  #ifdef ABSL_HAVE_THREAD_SANITIZER
2777
- extern "C" void __tsan_read1(void *addr);
2774
+ extern "C" void __tsan_read1(void* addr);
2778
2775
  #else
2779
2776
  #define __tsan_read1(addr) // do nothing if TSan not enabled
2780
2777
  #endif
2781
2778
 
2782
2779
  // A function that just returns its argument, dereferenced
2783
- static bool Dereference(void *arg) {
2780
+ static bool Dereference(void* arg) {
2784
2781
  // ThreadSanitizer does not instrument this file for memory accesses.
2785
2782
  // This function dereferences a user variable that can participate
2786
2783
  // in a data race, so we need to manually tell TSan about this memory access.
2787
2784
  __tsan_read1(arg);
2788
- return *(static_cast<bool *>(arg));
2785
+ return *(static_cast<bool*>(arg));
2789
2786
  }
2790
2787
 
2791
2788
  ABSL_CONST_INIT const Condition Condition::kTrue;
2792
2789
 
2793
- Condition::Condition(bool (*func)(void *), void *arg)
2794
- : eval_(&CallVoidPtrFunction),
2795
- arg_(arg) {
2790
+ Condition::Condition(bool (*func)(void*), void* arg)
2791
+ : eval_(&CallVoidPtrFunction), arg_(arg) {
2796
2792
  static_assert(sizeof(&func) <= sizeof(callback_),
2797
2793
  "An overlarge function pointer passed to Condition.");
2798
2794
  StoreCallback(func);
2799
2795
  }
2800
2796
 
2801
- bool Condition::CallVoidPtrFunction(const Condition *c) {
2802
- using FunctionPointer = bool (*)(void *);
2797
+ bool Condition::CallVoidPtrFunction(const Condition* c) {
2798
+ using FunctionPointer = bool (*)(void*);
2803
2799
  FunctionPointer function_pointer;
2804
2800
  std::memcpy(&function_pointer, c->callback_, sizeof(function_pointer));
2805
2801
  return (*function_pointer)(c->arg_);
2806
2802
  }
2807
2803
 
2808
- Condition::Condition(const bool *cond)
2804
+ Condition::Condition(const bool* cond)
2809
2805
  : eval_(CallVoidPtrFunction),
2810
2806
  // const_cast is safe since Dereference does not modify arg
2811
- arg_(const_cast<bool *>(cond)) {
2812
- using FunctionPointer = bool (*)(void *);
2807
+ arg_(const_cast<bool*>(cond)) {
2808
+ using FunctionPointer = bool (*)(void*);
2813
2809
  const FunctionPointer dereference = Dereference;
2814
2810
  StoreCallback(dereference);
2815
2811
  }
@@ -2819,7 +2815,7 @@ bool Condition::Eval() const {
2819
2815
  return (this->eval_ == nullptr) || (*this->eval_)(this);
2820
2816
  }
2821
2817
 
2822
- bool Condition::GuaranteedEqual(const Condition *a, const Condition *b) {
2818
+ bool Condition::GuaranteedEqual(const Condition* a, const Condition* b) {
2823
2819
  // kTrue logic.
2824
2820
  if (a == nullptr || a->eval_ == nullptr) {
2825
2821
  return b == nullptr || b->eval_ == nullptr;