grpc 1.52.2 → 1.53.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +50 -5
- data/include/grpc/event_engine/event_engine.h +24 -2
- data/include/grpc/event_engine/slice_buffer.h +13 -1
- data/include/grpc/impl/grpc_types.h +3 -0
- data/include/grpc/support/time.h +6 -4
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +148 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.h +52 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_provider.h +29 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +3 -3
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +3 -3
- data/src/core/ext/filters/client_channel/backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/backup_poller.h +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +29 -33
- data/src/core/ext/filters/client_channel/client_channel.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_factory.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/config_selector.h +3 -3
- data/src/core/ext/filters/client_channel/connector.h +8 -4
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.h +3 -3
- data/src/core/ext/filters/client_channel/http_proxy.h +3 -3
- data/src/core/ext/filters/client_channel/lb_call_state_internal.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +14 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +1 -78
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +117 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +128 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.h +71 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +972 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +3 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +12 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +275 -107
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.h +10 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +5 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +6 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +1 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +3 -7
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/retry_filter.cc +10 -13
- data/src/core/ext/filters/client_channel/retry_filter.h +3 -3
- data/src/core/ext/filters/client_channel/retry_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/retry_throttle.h +3 -3
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +4 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +5 -1
- data/src/core/ext/filters/client_channel/subchannel.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +3 -3
- data/src/core/ext/filters/deadline/deadline_filter.cc +40 -48
- data/src/core/ext/filters/deadline/deadline_filter.h +6 -10
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +3 -3
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +3 -3
- data/src/core/ext/filters/http/client/http_client_filter.cc +26 -21
- data/src/core/ext/filters/http/client/http_client_filter.h +3 -3
- data/src/core/ext/filters/http/client_authority_filter.h +3 -3
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +109 -117
- data/src/core/ext/filters/http/message_compress/compression_filter.h +17 -10
- data/src/core/ext/filters/http/server/http_server_filter.cc +25 -24
- data/src/core/ext/filters/http/server/http_server_filter.h +3 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +2 -1
- data/src/core/ext/filters/message_size/message_size_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_filter.cc +4 -3
- data/src/core/ext/filters/rbac/rbac_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +3 -3
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +27 -37
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +5 -5
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +3 -3
- data/src/core/ext/transport/chttp2/alpn/alpn.h +3 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +195 -111
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +3 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +17 -406
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http_trace.h +3 -3
- data/src/core/ext/transport/chttp2/transport/huffsyms.h +3 -3
- data/src/core/ext/transport/chttp2/transport/internal.h +28 -23
- data/src/core/ext/transport/chttp2/transport/parsing.cc +111 -31
- data/src/core/ext/transport/chttp2/transport/stream_map.h +3 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +3 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +9 -8
- data/src/core/ext/transport/inproc/inproc_transport.h +3 -3
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +38 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +185 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +44 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +16 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +48 -74
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +30 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +137 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +15 -12
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +83 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +17 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +61 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +11 -5
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +37 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +22 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +24 -5
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +50 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +57 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +254 -17
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +21 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +23 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +10 -7
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +42 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +188 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +111 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +444 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +31 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +113 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +114 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +3 -1
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +54 -53
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +34 -13
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +195 -187
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +232 -224
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +95 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +94 -93
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +81 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +189 -187
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +7 -3
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +137 -133
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +16 -12
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +140 -133
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +81 -70
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +771 -741
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +16 -14
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +14 -13
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +20 -18
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +53 -42
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +363 -356
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +149 -145
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +48 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +14 -14
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +10 -9
- data/src/core/ext/xds/certificate_provider_store.h +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +1 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +3 -3
- data/src/core/ext/xds/upb_utils.h +3 -3
- data/src/core/ext/xds/xds_api.h +3 -3
- data/src/core/ext/xds/xds_bootstrap.h +3 -3
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +1 -0
- data/src/core/ext/xds/xds_bootstrap_grpc.h +3 -3
- data/src/core/ext/xds/xds_certificate_provider.h +3 -3
- data/src/core/ext/xds/xds_channel_args.h +3 -3
- data/src/core/ext/xds/xds_channel_stack_modifier.h +3 -3
- data/src/core/ext/xds/xds_client.cc +8 -3
- data/src/core/ext/xds/xds_client.h +3 -3
- data/src/core/ext/xds/xds_client_grpc.cc +0 -1
- data/src/core/ext/xds/xds_client_grpc.h +3 -3
- data/src/core/ext/xds/xds_client_stats.h +4 -3
- data/src/core/ext/xds/xds_cluster.cc +11 -7
- data/src/core/ext/xds/xds_cluster.h +6 -6
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +3 -3
- data/src/core/ext/xds/xds_common_types.cc +1 -0
- data/src/core/ext/xds/xds_common_types.h +3 -3
- data/src/core/ext/xds/xds_endpoint.cc +1 -1
- data/src/core/ext/xds/xds_endpoint.h +3 -3
- data/src/core/ext/xds/xds_health_status.h +30 -3
- data/src/core/ext/xds/xds_http_fault_filter.h +3 -3
- data/src/core/ext/xds/xds_http_filters.cc +1 -1
- data/src/core/ext/xds/xds_http_filters.h +3 -3
- data/src/core/ext/xds/xds_http_rbac_filter.h +3 -3
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +3 -3
- data/src/core/ext/xds/xds_lb_policy_registry.cc +95 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +3 -3
- data/src/core/ext/xds/xds_listener.cc +1 -0
- data/src/core/ext/xds/xds_listener.h +3 -3
- data/src/core/ext/xds/xds_resource_type.h +3 -3
- data/src/core/ext/xds/xds_resource_type_impl.h +3 -3
- data/src/core/ext/xds/xds_route_config.cc +6 -0
- data/src/core/ext/xds/xds_route_config.h +3 -3
- data/src/core/ext/xds/xds_routing.h +3 -3
- data/src/core/ext/xds/xds_transport.h +3 -3
- data/src/core/ext/xds/xds_transport_grpc.h +3 -3
- data/src/core/lib/address_utils/parse_address.h +3 -3
- data/src/core/lib/address_utils/sockaddr_utils.cc +1 -0
- data/src/core/lib/address_utils/sockaddr_utils.h +3 -3
- data/src/core/lib/avl/avl.h +3 -3
- data/src/core/lib/backoff/backoff.h +3 -3
- data/src/core/lib/channel/call_finalization.h +3 -3
- data/src/core/lib/channel/call_tracer.h +3 -3
- data/src/core/lib/channel/channel_args.cc +1 -0
- data/src/core/lib/channel/channel_args.h +11 -5
- data/src/core/lib/channel/channel_args_preconditioning.h +3 -3
- data/src/core/lib/channel/channel_fwd.h +3 -3
- data/src/core/lib/channel/channel_stack.cc +1 -2
- data/src/core/lib/channel/channel_stack.h +4 -4
- data/src/core/lib/channel/channel_stack_builder.h +3 -3
- data/src/core/lib/channel/channel_stack_builder_impl.cc +14 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +3 -3
- data/src/core/lib/channel/channel_trace.h +3 -3
- data/src/core/lib/channel/channelz.h +3 -3
- data/src/core/lib/channel/channelz_registry.h +3 -3
- data/src/core/lib/channel/connected_channel.cc +883 -354
- data/src/core/lib/channel/connected_channel.h +3 -3
- data/src/core/lib/channel/context.h +7 -3
- data/src/core/lib/channel/promise_based_filter.cc +509 -259
- data/src/core/lib/channel/promise_based_filter.h +118 -43
- data/src/core/lib/channel/status_util.h +3 -3
- data/src/core/lib/compression/compression_internal.h +3 -3
- data/src/core/lib/compression/message_compress.h +3 -3
- data/src/core/lib/config/core_configuration.h +3 -3
- data/src/core/lib/debug/event_log.h +3 -3
- data/src/core/lib/debug/histogram_view.h +3 -3
- data/src/core/lib/debug/stats.h +3 -3
- data/src/core/lib/debug/stats_data.cc +66 -65
- data/src/core/lib/debug/stats_data.h +42 -33
- data/src/core/lib/debug/trace.h +4 -26
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +5 -0
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -3
- data/src/core/lib/event_engine/common_closures.h +3 -3
- data/src/core/lib/event_engine/default_event_engine.cc +9 -4
- data/src/core/lib/event_engine/default_event_engine.h +30 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +3 -3
- data/src/core/lib/event_engine/event_engine.cc +25 -0
- data/src/core/lib/event_engine/executor/executor.h +3 -3
- data/src/core/lib/event_engine/forkable.cc +11 -6
- data/src/core/lib/event_engine/forkable.h +3 -3
- data/src/core/lib/event_engine/handle_containers.h +10 -3
- data/src/core/lib/event_engine/poller.h +3 -3
- data/src/core/lib/event_engine/posix.h +158 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +44 -16
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +14 -4
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +6 -7
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.h +3 -3
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +3 -3
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +52 -55
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +46 -13
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +82 -12
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +23 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +60 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +65 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +0 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -6
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_heap.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +3 -3
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -3
- data/src/core/lib/event_engine/resolved_address.cc +19 -0
- data/src/core/lib/event_engine/resolved_address_internal.h +34 -0
- data/src/core/lib/event_engine/shim.cc +56 -0
- data/src/core/lib/event_engine/shim.h +33 -0
- data/src/core/lib/event_engine/slice.cc +1 -1
- data/src/core/lib/event_engine/tcp_socket_utils.cc +18 -2
- data/src/core/lib/event_engine/tcp_socket_utils.h +8 -3
- data/src/core/lib/event_engine/thread_local.cc +29 -0
- data/src/core/lib/event_engine/thread_local.h +32 -0
- data/src/core/lib/event_engine/thread_pool.cc +41 -65
- data/src/core/lib/event_engine/thread_pool.h +21 -17
- data/src/core/lib/event_engine/time_util.h +3 -3
- data/src/core/lib/event_engine/trace.cc +6 -0
- data/src/core/lib/event_engine/trace.h +16 -3
- data/src/core/lib/event_engine/utils.cc +2 -2
- data/src/core/lib/event_engine/utils.h +12 -4
- data/src/core/lib/event_engine/windows/iocp.cc +24 -40
- data/src/core/lib/event_engine/windows/iocp.h +3 -3
- data/src/core/lib/event_engine/windows/win_socket.cc +56 -33
- data/src/core/lib/event_engine/windows/win_socket.h +34 -25
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +331 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +103 -0
- data/src/core/lib/event_engine/windows/windows_engine.cc +243 -20
- data/src/core/lib/event_engine/windows/windows_engine.h +62 -23
- data/src/core/lib/experiments/config.cc +16 -1
- data/src/core/lib/experiments/config.h +13 -3
- data/src/core/lib/experiments/experiments.cc +14 -8
- data/src/core/lib/experiments/experiments.h +80 -21
- data/src/core/lib/gpr/alloc.h +3 -3
- data/src/core/lib/gpr/spinlock.h +3 -3
- data/src/core/lib/gpr/string.h +3 -3
- data/src/core/lib/gpr/sync_abseil.cc +15 -7
- data/src/core/lib/gpr/time_precise.h +3 -3
- data/src/core/lib/gpr/tmpfile.h +3 -3
- data/src/core/lib/gpr/useful.h +3 -3
- data/src/core/lib/gprpp/atomic_utils.h +3 -3
- data/src/core/lib/gprpp/bitset.h +3 -3
- data/src/core/lib/gprpp/chunked_vector.h +3 -3
- data/src/core/lib/gprpp/construct_destruct.h +3 -3
- data/src/core/lib/gprpp/cpp_impl_of.h +3 -3
- data/src/core/lib/gprpp/crash.h +3 -3
- data/src/core/lib/gprpp/debug_location.h +3 -6
- data/src/core/lib/gprpp/dual_ref_counted.h +3 -3
- data/src/core/lib/gprpp/env.h +3 -3
- data/src/core/lib/gprpp/examine_stack.h +3 -3
- data/src/core/lib/gprpp/fork.cc +21 -4
- data/src/core/lib/gprpp/fork.h +7 -5
- data/src/core/lib/gprpp/global_config.h +3 -3
- data/src/core/lib/gprpp/global_config_custom.h +3 -3
- data/src/core/lib/gprpp/global_config_env.cc +1 -0
- data/src/core/lib/gprpp/global_config_env.h +3 -3
- data/src/core/lib/gprpp/global_config_generic.h +3 -3
- data/src/core/lib/gprpp/host_port.cc +2 -0
- data/src/core/lib/gprpp/host_port.h +3 -3
- data/src/core/lib/gprpp/load_file.h +3 -3
- data/src/core/lib/gprpp/manual_constructor.h +3 -3
- data/src/core/lib/gprpp/match.h +3 -3
- data/src/core/lib/gprpp/memory.h +3 -3
- data/src/core/lib/gprpp/mpscq.h +3 -3
- data/src/core/lib/gprpp/no_destruct.h +3 -3
- data/src/core/lib/gprpp/notification.h +3 -3
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/overload.h +3 -3
- data/src/core/lib/gprpp/packed_table.h +3 -3
- data/src/core/lib/gprpp/per_cpu.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +3 -3
- data/src/core/lib/gprpp/single_set_ptr.h +3 -3
- data/src/core/lib/gprpp/sorted_pack.h +3 -3
- data/src/core/lib/gprpp/stat.h +3 -3
- data/src/core/lib/gprpp/status_helper.h +3 -3
- data/src/core/lib/gprpp/strerror.cc +2 -0
- data/src/core/lib/gprpp/strerror.h +3 -3
- data/src/core/lib/gprpp/sync.h +3 -3
- data/src/core/lib/gprpp/table.h +3 -3
- data/src/core/lib/gprpp/tchar.h +3 -3
- data/src/core/lib/gprpp/thd.h +3 -3
- data/src/core/lib/gprpp/time.cc +1 -0
- data/src/core/lib/gprpp/time.h +3 -3
- data/src/core/lib/gprpp/time_averaged_stats.h +3 -3
- data/src/core/lib/gprpp/time_util.h +3 -3
- data/src/core/lib/gprpp/unique_type_name.h +3 -3
- data/src/core/lib/gprpp/validation_errors.h +3 -3
- data/src/core/lib/gprpp/work_serializer.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper_registry.h +3 -3
- data/src/core/lib/http/format_request.cc +1 -0
- data/src/core/lib/http/format_request.h +3 -3
- data/src/core/lib/http/httpcli.cc +1 -0
- data/src/core/lib/http/httpcli.h +3 -3
- data/src/core/lib/http/httpcli_ssl_credentials.h +3 -3
- data/src/core/lib/http/parser.h +3 -3
- data/src/core/lib/iomgr/block_annotate.h +3 -3
- data/src/core/lib/iomgr/buffer_list.h +3 -3
- data/src/core/lib/iomgr/call_combiner.cc +4 -4
- data/src/core/lib/iomgr/call_combiner.h +3 -3
- data/src/core/lib/iomgr/cfstream_handle.h +3 -3
- data/src/core/lib/iomgr/closure.cc +27 -0
- data/src/core/lib/iomgr/closure.h +5 -3
- data/src/core/lib/iomgr/combiner.h +3 -3
- data/src/core/lib/iomgr/dynamic_annotations.h +3 -3
- data/src/core/lib/iomgr/endpoint.h +3 -3
- data/src/core/lib/iomgr/endpoint_cfstream.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +10 -2
- data/src/core/lib/iomgr/error.h +3 -3
- data/src/core/lib/iomgr/error_cfstream.h +3 -3
- data/src/core/lib/iomgr/ev_apple.h +3 -3
- data/src/core/lib/iomgr/ev_epoll1_linux.h +3 -3
- data/src/core/lib/iomgr/ev_poll_posix.h +3 -3
- data/src/core/lib/iomgr/ev_posix.h +3 -3
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +62 -0
- data/src/core/lib/iomgr/event_engine_shims/closure.h +39 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +430 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +43 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +91 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.h +44 -0
- data/src/core/lib/iomgr/exec_ctx.h +3 -3
- data/src/core/lib/iomgr/executor.h +3 -3
- data/src/core/lib/iomgr/fork_posix.cc +5 -4
- data/src/core/lib/iomgr/gethostname.h +3 -3
- data/src/core/lib/iomgr/grpc_if_nametoindex.h +3 -3
- data/src/core/lib/iomgr/internal_errqueue.h +3 -3
- data/src/core/lib/iomgr/iocp_windows.h +3 -3
- data/src/core/lib/iomgr/iomgr.h +3 -3
- data/src/core/lib/iomgr/iomgr_fwd.h +3 -3
- data/src/core/lib/iomgr/iomgr_internal.h +3 -3
- data/src/core/lib/iomgr/load_file.h +3 -3
- data/src/core/lib/iomgr/lockfree_event.h +3 -3
- data/src/core/lib/iomgr/nameser.h +3 -3
- data/src/core/lib/iomgr/polling_entity.h +3 -3
- data/src/core/lib/iomgr/pollset.h +3 -3
- data/src/core/lib/iomgr/pollset_set.h +3 -3
- data/src/core/lib/iomgr/pollset_set_windows.h +3 -3
- data/src/core/lib/iomgr/pollset_windows.cc +2 -2
- data/src/core/lib/iomgr/pollset_windows.h +3 -3
- data/src/core/lib/iomgr/port.h +3 -3
- data/src/core/lib/iomgr/python_util.h +3 -3
- data/src/core/lib/iomgr/resolve_address.h +3 -3
- data/src/core/lib/iomgr/resolve_address_impl.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.h +3 -3
- data/src/core/lib/iomgr/resolve_address_windows.h +3 -3
- data/src/core/lib/iomgr/resolved_address.h +3 -3
- data/src/core/lib/iomgr/sockaddr.h +3 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +3 -3
- data/src/core/lib/iomgr/sockaddr_windows.h +3 -3
- data/src/core/lib/iomgr/socket_factory_posix.h +3 -3
- data/src/core/lib/iomgr/socket_mutator.h +3 -3
- data/src/core/lib/iomgr/socket_utils.h +3 -3
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -3
- data/src/core/lib/iomgr/socket_windows.h +3 -3
- data/src/core/lib/iomgr/systemd_utils.cc +19 -19
- data/src/core/lib/iomgr/systemd_utils.h +24 -24
- data/src/core/lib/iomgr/tcp_client.h +3 -3
- data/src/core/lib/iomgr/tcp_client_posix.cc +12 -0
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_client_windows.cc +13 -1
- data/src/core/lib/iomgr/tcp_posix.cc +49 -65
- data/src/core/lib/iomgr/tcp_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_server.h +3 -3
- data/src/core/lib/iomgr/tcp_server_posix.cc +219 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +4 -6
- data/src/core/lib/iomgr/tcp_windows.h +3 -3
- data/src/core/lib/iomgr/timer.h +3 -3
- data/src/core/lib/iomgr/timer_generic.h +3 -3
- data/src/core/lib/iomgr/timer_heap.h +3 -3
- data/src/core/lib/iomgr/timer_manager.h +3 -3
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -3
- data/src/core/lib/json/json.h +3 -3
- data/src/core/lib/json/json_args.h +3 -3
- data/src/core/lib/json/json_channel_args.h +3 -3
- data/src/core/lib/json/json_object_loader.h +3 -3
- data/src/core/lib/json/json_reader.cc +1 -0
- data/src/core/lib/json/json_util.h +3 -3
- data/src/core/lib/load_balancing/lb_policy.cc +9 -0
- data/src/core/lib/load_balancing/lb_policy.h +9 -5
- data/src/core/lib/load_balancing/lb_policy_factory.h +3 -3
- data/src/core/lib/load_balancing/lb_policy_registry.cc +1 -0
- data/src/core/lib/load_balancing/lb_policy_registry.h +3 -3
- data/src/core/lib/load_balancing/subchannel_interface.h +8 -6
- data/src/core/lib/matchers/matchers.cc +1 -0
- data/src/core/lib/matchers/matchers.h +3 -3
- data/src/core/lib/promise/activity.cc +8 -6
- data/src/core/lib/promise/activity.h +52 -66
- data/src/core/lib/promise/arena_promise.h +3 -3
- data/src/core/lib/promise/context.h +3 -3
- data/src/core/lib/promise/detail/basic_join.h +197 -0
- data/src/core/lib/promise/detail/basic_seq.h +10 -16
- data/src/core/lib/promise/detail/promise_factory.h +3 -3
- data/src/core/lib/promise/detail/promise_like.h +3 -3
- data/src/core/lib/promise/detail/status.h +3 -3
- data/src/core/lib/promise/detail/switch.h +3 -3
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +3 -3
- data/src/core/lib/promise/if.h +195 -0
- data/src/core/lib/promise/interceptor_list.h +308 -0
- data/src/core/lib/promise/intra_activity_waiter.h +9 -3
- data/src/core/lib/promise/latch.h +99 -5
- data/src/core/lib/promise/loop.h +4 -4
- data/src/core/lib/promise/map.h +4 -6
- data/src/core/lib/promise/pipe.h +296 -193
- data/src/core/lib/promise/poll.h +113 -14
- data/src/core/lib/promise/promise.h +4 -5
- data/src/core/lib/promise/race.h +6 -9
- data/src/core/lib/promise/seq.h +3 -3
- data/src/core/lib/promise/sleep.h +3 -3
- data/src/core/lib/promise/{pipe.cc → trace.cc} +3 -2
- data/src/core/lib/promise/trace.h +24 -0
- data/src/core/lib/promise/try_join.h +82 -0
- data/src/core/lib/promise/try_seq.h +3 -3
- data/src/core/lib/resolver/resolver.h +3 -3
- data/src/core/lib/resolver/resolver_factory.h +4 -4
- data/src/core/lib/resolver/resolver_registry.cc +15 -0
- data/src/core/lib/resolver/resolver_registry.h +3 -3
- data/src/core/lib/resolver/server_address.cc +1 -0
- data/src/core/lib/resolver/server_address.h +3 -3
- data/src/core/lib/resource_quota/api.h +3 -3
- data/src/core/lib/resource_quota/arena.cc +36 -9
- data/src/core/lib/resource_quota/arena.h +84 -22
- data/src/core/lib/resource_quota/memory_quota.h +3 -3
- data/src/core/lib/resource_quota/periodic_update.h +3 -3
- data/src/core/lib/resource_quota/resource_quota.h +3 -3
- data/src/core/lib/resource_quota/thread_quota.h +3 -3
- data/src/core/lib/resource_quota/trace.h +3 -3
- data/src/core/lib/security/authorization/authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/authorization_policy_provider.h +3 -3
- data/src/core/lib/security/authorization/evaluate_args.h +3 -3
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +3 -3
- data/src/core/lib/security/authorization/matchers.h +3 -3
- data/src/core/lib/security/authorization/rbac_policy.cc +1 -0
- data/src/core/lib/security/authorization/rbac_policy.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +3 -3
- data/src/core/lib/security/context/security_context.h +3 -3
- data/src/core/lib/security/credentials/alts/alts_credentials.h +3 -3
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +3 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/call_creds_util.h +3 -3
- data/src/core/lib/security/credentials/channel_creds_registry.h +3 -3
- data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -3
- data/src/core/lib/security/credentials/credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +3 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/fake/fake_credentials.h +3 -3
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +1 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +3 -3
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +3 -3
- data/src/core/lib/security/credentials/jwt/json_token.h +3 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +4 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/local/local_credentials.h +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +4 -3
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +3 -3
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_utils.h +3 -3
- data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +3 -3
- data/src/core/lib/security/security_connector/local/local_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils_config.h +3 -3
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +3 -3
- data/src/core/lib/security/transport/auth_filters.h +27 -5
- data/src/core/lib/security/transport/secure_endpoint.h +3 -3
- data/src/core/lib/security/transport/security_handshaker.cc +9 -0
- data/src/core/lib/security/transport/security_handshaker.h +3 -3
- data/src/core/lib/security/transport/server_auth_filter.cc +120 -251
- data/src/core/lib/security/transport/tsi_error.h +3 -3
- data/src/core/lib/security/util/json_util.h +3 -3
- data/src/core/lib/service_config/service_config.h +3 -3
- data/src/core/lib/service_config/service_config_call_data.h +3 -3
- data/src/core/lib/service_config/service_config_impl.h +3 -3
- data/src/core/lib/service_config/service_config_parser.h +3 -3
- data/src/core/lib/slice/b64.h +3 -3
- data/src/core/lib/slice/percent_encoding.h +3 -3
- data/src/core/lib/slice/slice.cc +3 -3
- data/src/core/lib/slice/slice.h +14 -21
- data/src/core/lib/slice/slice_buffer.h +10 -4
- data/src/core/lib/slice/slice_internal.h +3 -3
- data/src/core/lib/slice/slice_refcount.cc +20 -0
- data/src/core/lib/slice/slice_refcount.h +26 -6
- data/src/core/lib/slice/slice_string_helpers.h +3 -3
- data/src/core/lib/surface/api_trace.h +3 -3
- data/src/core/lib/surface/builtins.h +3 -3
- data/src/core/lib/surface/call.cc +866 -252
- data/src/core/lib/surface/call.h +31 -3
- data/src/core/lib/surface/call_log_batch.cc +1 -0
- data/src/core/lib/surface/call_test_only.h +3 -3
- data/src/core/lib/surface/call_trace.cc +21 -11
- data/src/core/lib/surface/call_trace.h +3 -3
- data/src/core/lib/surface/channel.h +3 -3
- data/src/core/lib/surface/channel_init.h +3 -3
- data/src/core/lib/surface/channel_stack_type.h +3 -3
- data/src/core/lib/surface/completion_queue.cc +1 -0
- data/src/core/lib/surface/completion_queue.h +3 -3
- data/src/core/lib/surface/completion_queue_factory.h +3 -3
- data/src/core/lib/surface/event_string.cc +1 -0
- data/src/core/lib/surface/event_string.h +3 -3
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/init.h +3 -3
- data/src/core/lib/surface/init_internally.h +3 -3
- data/src/core/lib/surface/lame_client.cc +3 -1
- data/src/core/lib/surface/lame_client.h +3 -3
- data/src/core/lib/surface/server.cc +273 -27
- data/src/core/lib/surface/server.h +6 -3
- data/src/core/lib/surface/validate_metadata.h +3 -3
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.h +3 -3
- data/src/core/lib/transport/connectivity_state.h +3 -3
- data/src/core/lib/transport/error_utils.h +3 -3
- data/src/core/lib/transport/handshaker.cc +11 -0
- data/src/core/lib/transport/handshaker.h +4 -4
- data/src/core/lib/transport/handshaker_factory.h +3 -3
- data/src/core/lib/transport/handshaker_registry.h +3 -3
- data/src/core/lib/transport/http2_errors.h +3 -3
- data/src/core/lib/transport/http_connect_handshaker.h +3 -3
- data/src/core/lib/transport/metadata_batch.h +3 -3
- data/src/core/lib/transport/parsed_metadata.h +3 -3
- data/src/core/lib/transport/pid_controller.h +3 -3
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +0 -1
- data/src/core/lib/transport/tcp_connect_handshaker.h +3 -3
- data/src/core/lib/transport/timeout_encoding.h +3 -3
- data/src/core/lib/transport/transport.cc +3 -8
- data/src/core/lib/transport/transport.h +16 -8
- data/src/core/lib/transport/transport_fwd.h +3 -3
- data/src/core/lib/transport/transport_impl.h +3 -3
- data/src/core/lib/transport/transport_op_string.cc +1 -0
- data/src/core/lib/uri/uri_parser.cc +1 -1
- data/src/core/lib/uri/uri_parser.h +3 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +5 -0
- data/src/core/tsi/alts/crypt/gsec.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_counter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +3 -3
- data/src/core/tsi/alts/frame_protector/frame_handler.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_shared_resource.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +3 -3
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +3 -3
- data/src/core/tsi/fake_transport_security.h +3 -3
- data/src/core/tsi/local_transport_security.h +3 -3
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +1 -1
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -3
- data/src/core/tsi/ssl_transport_security.cc +113 -24
- data/src/core/tsi/ssl_transport_security.h +5 -3
- data/src/core/tsi/ssl_transport_security_utils.h +3 -3
- data/src/core/tsi/ssl_types.h +3 -3
- data/src/core/tsi/transport_security.h +3 -3
- data/src/core/tsi/transport_security_grpc.h +3 -3
- data/src/core/tsi/transport_security_interface.h +3 -3
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +0 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +56 -57
- data/third_party/abseil-cpp/absl/base/attributes.h +39 -19
- data/third_party/abseil-cpp/absl/base/config.h +44 -3
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +3 -18
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +55 -0
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +1 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +10 -6
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +23 -24
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +2 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +4 -1
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +14 -10
- data/third_party/abseil-cpp/absl/base/internal/thread_annotations.h +9 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -40
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +62 -0
- data/third_party/abseil-cpp/absl/base/macros.h +4 -21
- data/third_party/abseil-cpp/absl/base/optimization.h +58 -6
- data/third_party/abseil-cpp/absl/base/options.h +1 -7
- data/third_party/abseil-cpp/absl/base/policy_checks.h +15 -13
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -5
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -7
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +66 -18
- data/third_party/abseil-cpp/absl/container/internal/common.h +3 -3
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +132 -0
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +13 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +4 -55
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +50 -5
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +14 -46
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +110 -32
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +155 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +661 -341
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +99 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.h +183 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +256 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +57 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +468 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.h +91 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +269 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c.h +39 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c_inline.h +72 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +130 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +159 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +179 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy.h +119 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +75 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +434 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +93 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +725 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +79 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +180 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +67 -38
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -13
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +11 -9
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +40 -85
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +5 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +33 -8
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +118 -94
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +7 -6
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +5 -2
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +47 -26
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +10 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +18 -4
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +3 -14
- data/third_party/abseil-cpp/absl/memory/memory.h +26 -447
- data/third_party/abseil-cpp/absl/meta/type_traits.h +104 -12
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -3
- data/third_party/abseil-cpp/absl/numeric/int128.cc +10 -8
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +14 -6
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +2 -1
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +2 -23
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +9 -9
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +2 -2
- data/third_party/abseil-cpp/absl/random/random.h +6 -6
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +1 -0
- data/third_party/abseil-cpp/absl/status/status.cc +19 -12
- data/third_party/abseil-cpp/absl/status/status.h +2 -2
- data/third_party/abseil-cpp/absl/strings/ascii.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/charconv.cc +534 -96
- data/third_party/abseil-cpp/absl/strings/cord.cc +92 -40
- data/third_party/abseil-cpp/absl/strings/cord.h +71 -80
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +8 -5
- data/third_party/abseil-cpp/absl/strings/escaping.cc +73 -62
- data/third_party/abseil-cpp/absl/strings/escaping.h +24 -19
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +14 -12
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +326 -70
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +8 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +26 -14
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +9 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +5 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +7 -15
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +8 -5
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +93 -0
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +34 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +12 -10
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +7 -9
- data/third_party/abseil-cpp/absl/strings/internal/has_absl_stringify.h +55 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +14 -7
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +35 -10
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +113 -46
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +126 -29
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +4 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +49 -287
- data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +351 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +215 -181
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +10 -209
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +10 -101
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.cc +28 -0
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +57 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +34 -31
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/str_cat.h +50 -3
- data/third_party/abseil-cpp/absl/strings/str_format.h +71 -9
- data/third_party/abseil-cpp/absl/strings/string_view.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -10
- data/third_party/abseil-cpp/absl/strings/substitute.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.h +46 -20
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +20 -17
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +37 -31
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +22 -8
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +104 -55
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +85 -46
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +0 -1
- data/third_party/abseil-cpp/absl/synchronization/notification.h +0 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +26 -0
- data/third_party/abseil-cpp/absl/time/civil_time.h +25 -0
- data/third_party/abseil-cpp/absl/time/clock.cc +17 -11
- data/third_party/abseil-cpp/absl/time/duration.cc +7 -7
- data/third_party/abseil-cpp/absl/time/format.cc +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +26 -5
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +7 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +36 -35
- data/third_party/abseil-cpp/absl/time/time.cc +2 -2
- data/third_party/abseil-cpp/absl/time/time.h +253 -158
- data/third_party/abseil-cpp/absl/types/internal/span.h +30 -19
- data/third_party/abseil-cpp/absl/types/internal/variant.h +28 -40
- data/third_party/abseil-cpp/absl/types/span.h +29 -7
- metadata +75 -10
- data/src/core/lib/event_engine/socket_notifier.h +0 -55
- data/src/core/lib/promise/for_each.h +0 -155
- data/src/core/lib/promise/map_pipe.h +0 -88
- data/src/core/lib/promise/try_concurrently.h +0 -342
@@ -36,6 +36,9 @@
|
|
36
36
|
#include <algorithm>
|
37
37
|
#include <atomic>
|
38
38
|
#include <cinttypes>
|
39
|
+
#include <cstddef>
|
40
|
+
#include <cstring>
|
41
|
+
#include <iterator>
|
39
42
|
#include <thread> // NOLINT(build/c++11)
|
40
43
|
|
41
44
|
#include "absl/base/attributes.h"
|
@@ -51,6 +54,7 @@
|
|
51
54
|
#include "absl/base/internal/sysinfo.h"
|
52
55
|
#include "absl/base/internal/thread_identity.h"
|
53
56
|
#include "absl/base/internal/tsan_mutex_interface.h"
|
57
|
+
#include "absl/base/optimization.h"
|
54
58
|
#include "absl/base/port.h"
|
55
59
|
#include "absl/debugging/stacktrace.h"
|
56
60
|
#include "absl/debugging/symbolize.h"
|
@@ -134,25 +138,42 @@ enum DelayMode { AGGRESSIVE, GENTLE };
|
|
134
138
|
struct ABSL_CACHELINE_ALIGNED MutexGlobals {
|
135
139
|
absl::once_flag once;
|
136
140
|
int spinloop_iterations = 0;
|
137
|
-
int32_t
|
141
|
+
int32_t mutex_sleep_spins[2] = {};
|
142
|
+
absl::Duration mutex_sleep_time;
|
138
143
|
};
|
139
144
|
|
145
|
+
absl::Duration MeasureTimeToYield() {
|
146
|
+
absl::Time before = absl::Now();
|
147
|
+
ABSL_INTERNAL_C_SYMBOL(AbslInternalMutexYield)();
|
148
|
+
return absl::Now() - before;
|
149
|
+
}
|
150
|
+
|
140
151
|
const MutexGlobals &GetMutexGlobals() {
|
141
152
|
ABSL_CONST_INIT static MutexGlobals data;
|
142
153
|
absl::base_internal::LowLevelCallOnce(&data.once, [&]() {
|
143
154
|
const int num_cpus = absl::base_internal::NumCPUs();
|
144
155
|
data.spinloop_iterations = num_cpus > 1 ? 1500 : 0;
|
145
|
-
// If this a uniprocessor, only yield/sleep.
|
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
|
146
161
|
// aggressive then spin many times before yielding. If the mode is
|
147
162
|
// gentle then spin only a few times before yielding. Aggressive spinning
|
148
163
|
// is used to ensure that an Unlock() call, which must get the spin lock
|
149
164
|
// for any thread to make progress gets it without undue delay.
|
150
165
|
if (num_cpus > 1) {
|
151
|
-
data.
|
152
|
-
data.
|
166
|
+
data.mutex_sleep_spins[AGGRESSIVE] = 5000;
|
167
|
+
data.mutex_sleep_spins[GENTLE] = 250;
|
168
|
+
data.mutex_sleep_time = absl::Microseconds(10);
|
153
169
|
} else {
|
154
|
-
data.
|
155
|
-
data.
|
170
|
+
data.mutex_sleep_spins[AGGRESSIVE] = 0;
|
171
|
+
data.mutex_sleep_spins[GENTLE] = 0;
|
172
|
+
data.mutex_sleep_time = MeasureTimeToYield() * 5;
|
173
|
+
data.mutex_sleep_time =
|
174
|
+
std::min(data.mutex_sleep_time, absl::Milliseconds(1));
|
175
|
+
data.mutex_sleep_time =
|
176
|
+
std::max(data.mutex_sleep_time, absl::Microseconds(10));
|
156
177
|
}
|
157
178
|
});
|
158
179
|
return data;
|
@@ -163,7 +184,8 @@ namespace synchronization_internal {
|
|
163
184
|
// Returns the Mutex delay on iteration `c` depending on the given `mode`.
|
164
185
|
// The returned value should be used as `c` for the next call to `MutexDelay`.
|
165
186
|
int MutexDelay(int32_t c, int mode) {
|
166
|
-
const int32_t limit = GetMutexGlobals().
|
187
|
+
const int32_t limit = GetMutexGlobals().mutex_sleep_spins[mode];
|
188
|
+
const absl::Duration sleep_time = GetMutexGlobals().mutex_sleep_time;
|
167
189
|
if (c < limit) {
|
168
190
|
// Spin.
|
169
191
|
c++;
|
@@ -176,7 +198,7 @@ int MutexDelay(int32_t c, int mode) {
|
|
176
198
|
c++;
|
177
199
|
} else {
|
178
200
|
// Then wait.
|
179
|
-
absl::SleepFor(
|
201
|
+
absl::SleepFor(sleep_time);
|
180
202
|
c = 0;
|
181
203
|
}
|
182
204
|
ABSL_TSAN_MUTEX_POST_DIVERT(nullptr, 0);
|
@@ -325,7 +347,7 @@ static struct SynchEvent { // this is a trivial hash table for the events
|
|
325
347
|
static SynchEvent *EnsureSynchEvent(std::atomic<intptr_t> *addr,
|
326
348
|
const char *name, intptr_t bits,
|
327
349
|
intptr_t lockbit) {
|
328
|
-
uint32_t h = reinterpret_cast<
|
350
|
+
uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
|
329
351
|
SynchEvent *e;
|
330
352
|
// first look for existing SynchEvent struct..
|
331
353
|
synch_event_mu.Lock();
|
@@ -378,7 +400,7 @@ static void UnrefSynchEvent(SynchEvent *e) {
|
|
378
400
|
// is clear before doing so).
|
379
401
|
static void ForgetSynchEvent(std::atomic<intptr_t> *addr, intptr_t bits,
|
380
402
|
intptr_t lockbit) {
|
381
|
-
uint32_t h = reinterpret_cast<
|
403
|
+
uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
|
382
404
|
SynchEvent **pe;
|
383
405
|
SynchEvent *e;
|
384
406
|
synch_event_mu.Lock();
|
@@ -402,7 +424,7 @@ static void ForgetSynchEvent(std::atomic<intptr_t> *addr, intptr_t bits,
|
|
402
424
|
// "addr", if any. The pointer returned is valid until the UnrefSynchEvent() is
|
403
425
|
// called.
|
404
426
|
static SynchEvent *GetSynchEvent(const void *addr) {
|
405
|
-
uint32_t h = reinterpret_cast<
|
427
|
+
uint32_t h = reinterpret_cast<uintptr_t>(addr) % kNSynchEvent;
|
406
428
|
SynchEvent *e;
|
407
429
|
synch_event_mu.Lock();
|
408
430
|
for (e = synch_event[h];
|
@@ -430,7 +452,13 @@ static void PostSynchEvent(void *obj, int ev) {
|
|
430
452
|
char buffer[ABSL_ARRAYSIZE(pcs) * 24];
|
431
453
|
int pos = snprintf(buffer, sizeof (buffer), " @");
|
432
454
|
for (int i = 0; i != n; i++) {
|
433
|
-
|
455
|
+
int b = snprintf(&buffer[pos], sizeof(buffer) - static_cast<size_t>(pos),
|
456
|
+
" %p", pcs[i]);
|
457
|
+
if (b < 0 ||
|
458
|
+
static_cast<size_t>(b) >= sizeof(buffer) - static_cast<size_t>(pos)) {
|
459
|
+
break;
|
460
|
+
}
|
461
|
+
pos += b;
|
434
462
|
}
|
435
463
|
ABSL_RAW_LOG(INFO, "%s%p %s %s", event_properties[ev].msg, obj,
|
436
464
|
(e == nullptr ? "" : e->name), buffer);
|
@@ -486,7 +514,8 @@ struct SynchWaitParams {
|
|
486
514
|
cvmu(cvmu_arg),
|
487
515
|
thread(thread_arg),
|
488
516
|
cv_word(cv_word_arg),
|
489
|
-
contention_start_cycles(base_internal::CycleClock::Now())
|
517
|
+
contention_start_cycles(base_internal::CycleClock::Now()),
|
518
|
+
should_submit_contention_data(false) {}
|
490
519
|
|
491
520
|
const Mutex::MuHow how; // How this thread needs to wait.
|
492
521
|
const Condition *cond; // The condition that this thread is waiting for.
|
@@ -504,6 +533,7 @@ struct SynchWaitParams {
|
|
504
533
|
|
505
534
|
int64_t contention_start_cycles; // Time (in cycles) when this thread started
|
506
535
|
// to contend for the mutex.
|
536
|
+
bool should_submit_contention_data;
|
507
537
|
};
|
508
538
|
|
509
539
|
struct SynchLocksHeld {
|
@@ -562,10 +592,15 @@ static SynchLocksHeld *Synch_GetAllLocks() {
|
|
562
592
|
void Mutex::IncrementSynchSem(Mutex *mu, PerThreadSynch *w) {
|
563
593
|
if (mu) {
|
564
594
|
ABSL_TSAN_MUTEX_PRE_DIVERT(mu, 0);
|
565
|
-
|
566
|
-
|
567
|
-
|
595
|
+
// We miss synchronization around passing PerThreadSynch between threads
|
596
|
+
// since it happens inside of the Mutex code, so we need to ignore all
|
597
|
+
// accesses to the object.
|
598
|
+
ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN();
|
599
|
+
PerThreadSem::Post(w->thread_identity());
|
600
|
+
ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END();
|
568
601
|
ABSL_TSAN_MUTEX_POST_DIVERT(mu, 0);
|
602
|
+
} else {
|
603
|
+
PerThreadSem::Post(w->thread_identity());
|
569
604
|
}
|
570
605
|
}
|
571
606
|
|
@@ -1120,7 +1155,7 @@ void Mutex::TryRemove(PerThreadSynch *s) {
|
|
1120
1155
|
// if the wait extends past the absolute time specified, even if "s" is still
|
1121
1156
|
// on the mutex queue. In this case, remove "s" from the queue and return
|
1122
1157
|
// true, otherwise return false.
|
1123
|
-
|
1158
|
+
void Mutex::Block(PerThreadSynch *s) {
|
1124
1159
|
while (s->state.load(std::memory_order_acquire) == PerThreadSynch::kQueued) {
|
1125
1160
|
if (!DecrementSynchSem(this, s, s->waitp->timeout)) {
|
1126
1161
|
// After a timeout, we go into a spin loop until we remove ourselves
|
@@ -1273,15 +1308,17 @@ static char *StackString(void **pcs, int n, char *buf, int maxlen,
|
|
1273
1308
|
char sym[kSymLen];
|
1274
1309
|
int len = 0;
|
1275
1310
|
for (int i = 0; i != n; i++) {
|
1311
|
+
if (len >= maxlen)
|
1312
|
+
return buf;
|
1313
|
+
size_t count = static_cast<size_t>(maxlen - len);
|
1276
1314
|
if (symbolize) {
|
1277
1315
|
if (!symbolizer(pcs[i], sym, kSymLen)) {
|
1278
1316
|
sym[0] = '\0';
|
1279
1317
|
}
|
1280
|
-
snprintf(buf + len,
|
1281
|
-
|
1282
|
-
pcs[i], sym);
|
1318
|
+
snprintf(buf + len, count, "%s\t@ %p %s\n", (i == 0 ? "\n" : ""), pcs[i],
|
1319
|
+
sym);
|
1283
1320
|
} else {
|
1284
|
-
snprintf(buf + len,
|
1321
|
+
snprintf(buf + len, count, " %p", pcs[i]);
|
1285
1322
|
}
|
1286
1323
|
len += strlen(&buf[len]);
|
1287
1324
|
}
|
@@ -1366,12 +1403,12 @@ static GraphId DeadlockCheck(Mutex *mu) {
|
|
1366
1403
|
bool symbolize = number_of_reported_deadlocks <= 2;
|
1367
1404
|
ABSL_RAW_LOG(ERROR, "Potential Mutex deadlock: %s",
|
1368
1405
|
CurrentStackString(b->buf, sizeof (b->buf), symbolize));
|
1369
|
-
|
1406
|
+
size_t len = 0;
|
1370
1407
|
for (int j = 0; j != all_locks->n; j++) {
|
1371
1408
|
void* pr = deadlock_graph->Ptr(all_locks->locks[j].id);
|
1372
1409
|
if (pr != nullptr) {
|
1373
1410
|
snprintf(b->buf + len, sizeof (b->buf) - len, " %p", pr);
|
1374
|
-
len +=
|
1411
|
+
len += strlen(&b->buf[len]);
|
1375
1412
|
}
|
1376
1413
|
}
|
1377
1414
|
ABSL_RAW_LOG(ERROR,
|
@@ -1467,7 +1504,7 @@ static bool TryAcquireWithSpinning(std::atomic<intptr_t>* mu) {
|
|
1467
1504
|
return false;
|
1468
1505
|
}
|
1469
1506
|
|
1470
|
-
|
1507
|
+
void Mutex::Lock() {
|
1471
1508
|
ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
|
1472
1509
|
GraphId id = DebugOnlyDeadlockCheck(this);
|
1473
1510
|
intptr_t v = mu_.load(std::memory_order_relaxed);
|
@@ -1485,7 +1522,7 @@ ABSL_XRAY_LOG_ARGS(1) void Mutex::Lock() {
|
|
1485
1522
|
ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
|
1486
1523
|
}
|
1487
1524
|
|
1488
|
-
|
1525
|
+
void Mutex::ReaderLock() {
|
1489
1526
|
ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
|
1490
1527
|
GraphId id = DebugOnlyDeadlockCheck(this);
|
1491
1528
|
intptr_t v = mu_.load(std::memory_order_relaxed);
|
@@ -1598,7 +1635,7 @@ bool Mutex::AwaitCommon(const Condition &cond, KernelTimeout t) {
|
|
1598
1635
|
return res;
|
1599
1636
|
}
|
1600
1637
|
|
1601
|
-
|
1638
|
+
bool Mutex::TryLock() {
|
1602
1639
|
ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock);
|
1603
1640
|
intptr_t v = mu_.load(std::memory_order_relaxed);
|
1604
1641
|
if ((v & (kMuWriter | kMuReader | kMuEvent)) == 0 && // try fast acquire
|
@@ -1627,7 +1664,7 @@ ABSL_XRAY_LOG_ARGS(1) bool Mutex::TryLock() {
|
|
1627
1664
|
return false;
|
1628
1665
|
}
|
1629
1666
|
|
1630
|
-
|
1667
|
+
bool Mutex::ReaderTryLock() {
|
1631
1668
|
ABSL_TSAN_MUTEX_PRE_LOCK(this,
|
1632
1669
|
__tsan_mutex_read_lock | __tsan_mutex_try_lock);
|
1633
1670
|
intptr_t v = mu_.load(std::memory_order_relaxed);
|
@@ -1673,7 +1710,7 @@ ABSL_XRAY_LOG_ARGS(1) bool Mutex::ReaderTryLock() {
|
|
1673
1710
|
return false;
|
1674
1711
|
}
|
1675
1712
|
|
1676
|
-
|
1713
|
+
void Mutex::Unlock() {
|
1677
1714
|
ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0);
|
1678
1715
|
DebugOnlyLockLeave(this);
|
1679
1716
|
intptr_t v = mu_.load(std::memory_order_relaxed);
|
@@ -1725,7 +1762,7 @@ static bool ExactlyOneReader(intptr_t v) {
|
|
1725
1762
|
return (v & kMuMultipleWaitersMask) == 0;
|
1726
1763
|
}
|
1727
1764
|
|
1728
|
-
|
1765
|
+
void Mutex::ReaderUnlock() {
|
1729
1766
|
ABSL_TSAN_MUTEX_PRE_UNLOCK(this, __tsan_mutex_read_lock);
|
1730
1767
|
DebugOnlyLockLeave(this);
|
1731
1768
|
intptr_t v = mu_.load(std::memory_order_relaxed);
|
@@ -1755,7 +1792,7 @@ static intptr_t ClearDesignatedWakerMask(int flag) {
|
|
1755
1792
|
case 1: // blocked; turn off the designated waker bit
|
1756
1793
|
return ~static_cast<intptr_t>(kMuDesig);
|
1757
1794
|
}
|
1758
|
-
|
1795
|
+
ABSL_UNREACHABLE();
|
1759
1796
|
}
|
1760
1797
|
|
1761
1798
|
// Conditionally ignores the existence of waiting writers if a reader that has
|
@@ -1769,7 +1806,7 @@ static intptr_t IgnoreWaitingWritersMask(int flag) {
|
|
1769
1806
|
case 1: // blocked; pretend there are no waiting writers
|
1770
1807
|
return ~static_cast<intptr_t>(kMuWrWait);
|
1771
1808
|
}
|
1772
|
-
|
1809
|
+
ABSL_UNREACHABLE();
|
1773
1810
|
}
|
1774
1811
|
|
1775
1812
|
// Internal version of LockWhen(). See LockSlowWithDeadline()
|
@@ -1790,8 +1827,8 @@ static inline bool EvalConditionAnnotated(const Condition *cond, Mutex *mu,
|
|
1790
1827
|
// operation tsan considers that we've already released the mutex.
|
1791
1828
|
bool res = false;
|
1792
1829
|
#ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE
|
1793
|
-
const
|
1794
|
-
const
|
1830
|
+
const uint32_t flags = read_lock ? __tsan_mutex_read_lock : 0;
|
1831
|
+
const uint32_t tryflags = flags | (trylock ? __tsan_mutex_try_lock : 0);
|
1795
1832
|
#endif
|
1796
1833
|
if (locking) {
|
1797
1834
|
// For lock we pretend that we have finished the operation,
|
@@ -1904,7 +1941,7 @@ static void CheckForMutexCorruption(intptr_t v, const char* label) {
|
|
1904
1941
|
// Test for either of two situations that should not occur in v:
|
1905
1942
|
// kMuWriter and kMuReader
|
1906
1943
|
// kMuWrWait and !kMuWait
|
1907
|
-
const uintptr_t w = v ^ kMuWait;
|
1944
|
+
const uintptr_t w = static_cast<uintptr_t>(v ^ kMuWait);
|
1908
1945
|
// By flipping that bit, we can now test for:
|
1909
1946
|
// kMuWriter and kMuReader in w
|
1910
1947
|
// kMuWrWait and kMuWait in w
|
@@ -2331,21 +2368,26 @@ ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow(SynchWaitParams *waitp) {
|
|
2331
2368
|
} // end of for(;;)-loop
|
2332
2369
|
|
2333
2370
|
if (wake_list != kPerThreadSynchNull) {
|
2334
|
-
int64_t
|
2371
|
+
int64_t total_wait_cycles = 0;
|
2372
|
+
int64_t max_wait_cycles = 0;
|
2335
2373
|
int64_t now = base_internal::CycleClock::Now();
|
2336
2374
|
do {
|
2337
|
-
//
|
2375
|
+
// Profile lock contention events only if the waiter was trying to acquire
|
2338
2376
|
// the lock, not waiting on a condition variable or Condition.
|
2339
2377
|
if (!wake_list->cond_waiter) {
|
2340
|
-
|
2378
|
+
int64_t cycles_waited =
|
2379
|
+
(now - wake_list->waitp->contention_start_cycles);
|
2380
|
+
total_wait_cycles += cycles_waited;
|
2381
|
+
if (max_wait_cycles == 0) max_wait_cycles = cycles_waited;
|
2341
2382
|
wake_list->waitp->contention_start_cycles = now;
|
2383
|
+
wake_list->waitp->should_submit_contention_data = true;
|
2342
2384
|
}
|
2343
2385
|
wake_list = Wakeup(wake_list); // wake waiters
|
2344
2386
|
} while (wake_list != kPerThreadSynchNull);
|
2345
|
-
if (
|
2346
|
-
mutex_tracer("slow release", this,
|
2387
|
+
if (total_wait_cycles > 0) {
|
2388
|
+
mutex_tracer("slow release", this, total_wait_cycles);
|
2347
2389
|
ABSL_TSAN_MUTEX_PRE_DIVERT(this, 0);
|
2348
|
-
submit_profile_data(
|
2390
|
+
submit_profile_data(total_wait_cycles);
|
2349
2391
|
ABSL_TSAN_MUTEX_POST_DIVERT(this, 0);
|
2350
2392
|
}
|
2351
2393
|
}
|
@@ -2746,25 +2788,31 @@ static bool Dereference(void *arg) {
|
|
2746
2788
|
return *(static_cast<bool *>(arg));
|
2747
2789
|
}
|
2748
2790
|
|
2749
|
-
|
2750
|
-
const Condition Condition::kTrue;
|
2791
|
+
ABSL_CONST_INIT const Condition Condition::kTrue;
|
2751
2792
|
|
2752
2793
|
Condition::Condition(bool (*func)(void *), void *arg)
|
2753
2794
|
: eval_(&CallVoidPtrFunction),
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2795
|
+
arg_(arg) {
|
2796
|
+
static_assert(sizeof(&func) <= sizeof(callback_),
|
2797
|
+
"An overlarge function pointer passed to Condition.");
|
2798
|
+
StoreCallback(func);
|
2799
|
+
}
|
2757
2800
|
|
2758
2801
|
bool Condition::CallVoidPtrFunction(const Condition *c) {
|
2759
|
-
|
2802
|
+
using FunctionPointer = bool (*)(void *);
|
2803
|
+
FunctionPointer function_pointer;
|
2804
|
+
std::memcpy(&function_pointer, c->callback_, sizeof(function_pointer));
|
2805
|
+
return (*function_pointer)(c->arg_);
|
2760
2806
|
}
|
2761
2807
|
|
2762
2808
|
Condition::Condition(const bool *cond)
|
2763
2809
|
: eval_(CallVoidPtrFunction),
|
2764
|
-
function_(Dereference),
|
2765
|
-
method_(nullptr),
|
2766
2810
|
// const_cast is safe since Dereference does not modify arg
|
2767
|
-
arg_(const_cast<bool *>(cond)) {
|
2811
|
+
arg_(const_cast<bool *>(cond)) {
|
2812
|
+
using FunctionPointer = bool (*)(void *);
|
2813
|
+
const FunctionPointer dereference = Dereference;
|
2814
|
+
StoreCallback(dereference);
|
2815
|
+
}
|
2768
2816
|
|
2769
2817
|
bool Condition::Eval() const {
|
2770
2818
|
// eval_ == null for kTrue
|
@@ -2772,14 +2820,15 @@ bool Condition::Eval() const {
|
|
2772
2820
|
}
|
2773
2821
|
|
2774
2822
|
bool Condition::GuaranteedEqual(const Condition *a, const Condition *b) {
|
2775
|
-
|
2823
|
+
// kTrue logic.
|
2824
|
+
if (a == nullptr || a->eval_ == nullptr) {
|
2776
2825
|
return b == nullptr || b->eval_ == nullptr;
|
2826
|
+
} else if (b == nullptr || b->eval_ == nullptr) {
|
2827
|
+
return false;
|
2777
2828
|
}
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2781
|
-
return a->eval_ == b->eval_ && a->function_ == b->function_ &&
|
2782
|
-
a->arg_ == b->arg_ && a->method_ == b->method_;
|
2829
|
+
// Check equality of the representative fields.
|
2830
|
+
return a->eval_ == b->eval_ && a->arg_ == b->arg_ &&
|
2831
|
+
!memcmp(a->callback_, b->callback_, sizeof(a->callback_));
|
2783
2832
|
}
|
2784
2833
|
|
2785
2834
|
ABSL_NAMESPACE_END
|
@@ -60,6 +60,8 @@
|
|
60
60
|
|
61
61
|
#include <atomic>
|
62
62
|
#include <cstdint>
|
63
|
+
#include <cstring>
|
64
|
+
#include <iterator>
|
63
65
|
#include <string>
|
64
66
|
|
65
67
|
#include "absl/base/const_init.h"
|
@@ -612,12 +614,12 @@ class ABSL_SCOPED_LOCKABLE WriterMutexLock {
|
|
612
614
|
// Condition
|
613
615
|
// -----------------------------------------------------------------------------
|
614
616
|
//
|
615
|
-
//
|
616
|
-
//
|
617
|
-
//
|
618
|
-
//
|
619
|
-
//
|
620
|
-
//
|
617
|
+
// `Mutex` contains a number of member functions which take a `Condition` as an
|
618
|
+
// argument; clients can wait for conditions to become `true` before attempting
|
619
|
+
// to acquire the mutex. These sections are known as "condition critical"
|
620
|
+
// sections. To use a `Condition`, you simply need to construct it, and use
|
621
|
+
// within an appropriate `Mutex` member function; everything else in the
|
622
|
+
// `Condition` class is an implementation detail.
|
621
623
|
//
|
622
624
|
// A `Condition` is specified as a function pointer which returns a boolean.
|
623
625
|
// `Condition` functions should be pure functions -- their results should depend
|
@@ -727,7 +729,7 @@ class Condition {
|
|
727
729
|
: Condition(obj, static_cast<bool (T::*)() const>(&T::operator())) {}
|
728
730
|
|
729
731
|
// A Condition that always returns `true`.
|
730
|
-
static const Condition kTrue;
|
732
|
+
ABSL_CONST_INIT static const Condition kTrue;
|
731
733
|
|
732
734
|
// Evaluates the condition.
|
733
735
|
bool Eval() const;
|
@@ -742,22 +744,54 @@ class Condition {
|
|
742
744
|
static bool GuaranteedEqual(const Condition *a, const Condition *b);
|
743
745
|
|
744
746
|
private:
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
747
|
+
// Sizing an allocation for a method pointer can be subtle. In the Itanium
|
748
|
+
// specifications, a method pointer has a predictable, uniform size. On the
|
749
|
+
// other hand, MSVC ABI, method pointer sizes vary based on the
|
750
|
+
// inheritance of the class. Specifically, method pointers from classes with
|
751
|
+
// multiple inheritance are bigger than those of classes with single
|
752
|
+
// inheritance. Other variations also exist.
|
753
|
+
|
754
|
+
#ifndef _MSC_VER
|
755
|
+
// Allocation for a function pointer or method pointer.
|
756
|
+
// The {0} initializer ensures that all unused bytes of this buffer are
|
757
|
+
// always zeroed out. This is necessary, because GuaranteedEqual() compares
|
758
|
+
// all of the bytes, unaware of which bytes are relevant to a given `eval_`.
|
759
|
+
using MethodPtr = bool (Condition::*)();
|
760
|
+
char callback_[sizeof(MethodPtr)] = {0};
|
761
|
+
#else
|
762
|
+
// It is well known that the larget MSVC pointer-to-member is 24 bytes. This
|
763
|
+
// may be the largest known pointer-to-member of any platform. For this
|
764
|
+
// reason we will allocate 24 bytes for MSVC platform toolchains.
|
765
|
+
char callback_[24] = {0};
|
766
|
+
#endif
|
767
|
+
|
768
|
+
// Function with which to evaluate callbacks and/or arguments.
|
769
|
+
bool (*eval_)(const Condition*) = nullptr;
|
770
|
+
|
771
|
+
// Either an argument for a function call or an object for a method call.
|
772
|
+
void *arg_ = nullptr;
|
756
773
|
|
757
774
|
// Various functions eval_ can point to:
|
758
775
|
static bool CallVoidPtrFunction(const Condition*);
|
759
776
|
template <typename T> static bool CastAndCallFunction(const Condition* c);
|
760
777
|
template <typename T> static bool CastAndCallMethod(const Condition* c);
|
778
|
+
|
779
|
+
// Helper methods for storing, validating, and reading callback arguments.
|
780
|
+
template <typename T>
|
781
|
+
inline void StoreCallback(T callback) {
|
782
|
+
static_assert(
|
783
|
+
sizeof(callback) <= sizeof(callback_),
|
784
|
+
"An overlarge pointer was passed as a callback to Condition.");
|
785
|
+
std::memcpy(callback_, &callback, sizeof(callback));
|
786
|
+
}
|
787
|
+
|
788
|
+
template <typename T>
|
789
|
+
inline void ReadCallback(T *callback) const {
|
790
|
+
std::memcpy(callback, callback_, sizeof(*callback));
|
791
|
+
}
|
792
|
+
|
793
|
+
// Used only to create kTrue.
|
794
|
+
constexpr Condition() = default;
|
761
795
|
};
|
762
796
|
|
763
797
|
// -----------------------------------------------------------------------------
|
@@ -949,56 +983,61 @@ inline CondVar::CondVar() : cv_(0) {}
|
|
949
983
|
// static
|
950
984
|
template <typename T>
|
951
985
|
bool Condition::CastAndCallMethod(const Condition *c) {
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
return (
|
986
|
+
T *object = static_cast<T *>(c->arg_);
|
987
|
+
bool (T::*method_pointer)();
|
988
|
+
c->ReadCallback(&method_pointer);
|
989
|
+
return (object->*method_pointer)();
|
956
990
|
}
|
957
991
|
|
958
992
|
// static
|
959
993
|
template <typename T>
|
960
994
|
bool Condition::CastAndCallFunction(const Condition *c) {
|
961
|
-
|
962
|
-
|
963
|
-
T *
|
964
|
-
return (*
|
995
|
+
bool (*function)(T *);
|
996
|
+
c->ReadCallback(&function);
|
997
|
+
T *argument = static_cast<T *>(c->arg_);
|
998
|
+
return (*function)(argument);
|
965
999
|
}
|
966
1000
|
|
967
1001
|
template <typename T>
|
968
1002
|
inline Condition::Condition(bool (*func)(T *), T *arg)
|
969
1003
|
: eval_(&CastAndCallFunction<T>),
|
970
|
-
|
971
|
-
|
972
|
-
|
1004
|
+
arg_(const_cast<void *>(static_cast<const void *>(arg))) {
|
1005
|
+
static_assert(sizeof(&func) <= sizeof(callback_),
|
1006
|
+
"An overlarge function pointer was passed to Condition.");
|
1007
|
+
StoreCallback(func);
|
1008
|
+
}
|
973
1009
|
|
974
1010
|
template <typename T>
|
975
1011
|
inline Condition::Condition(T *object,
|
976
1012
|
bool (absl::internal::identity<T>::type::*method)())
|
977
1013
|
: eval_(&CastAndCallMethod<T>),
|
978
|
-
|
979
|
-
|
980
|
-
|
1014
|
+
arg_(object) {
|
1015
|
+
static_assert(sizeof(&method) <= sizeof(callback_),
|
1016
|
+
"An overlarge method pointer was passed to Condition.");
|
1017
|
+
StoreCallback(method);
|
1018
|
+
}
|
981
1019
|
|
982
1020
|
template <typename T>
|
983
1021
|
inline Condition::Condition(const T *object,
|
984
1022
|
bool (absl::internal::identity<T>::type::*method)()
|
985
1023
|
const)
|
986
1024
|
: eval_(&CastAndCallMethod<T>),
|
987
|
-
|
988
|
-
|
989
|
-
|
1025
|
+
arg_(reinterpret_cast<void *>(const_cast<T *>(object))) {
|
1026
|
+
StoreCallback(method);
|
1027
|
+
}
|
990
1028
|
|
991
|
-
// Register
|
1029
|
+
// Register hooks for profiling support.
|
992
1030
|
//
|
993
1031
|
// The function pointer registered here will be called whenever a mutex is
|
994
1032
|
// contended. The callback is given the cycles for which waiting happened (as
|
995
1033
|
// measured by //absl/base/internal/cycleclock.h, and which may not
|
996
1034
|
// be real "cycle" counts.)
|
997
1035
|
//
|
998
|
-
//
|
999
|
-
//
|
1000
|
-
//
|
1001
|
-
//
|
1036
|
+
// There is no ordering guarantee between when the hook is registered and when
|
1037
|
+
// callbacks will begin. Only a single profiler can be installed in a running
|
1038
|
+
// binary; if this function is called a second time with a different function
|
1039
|
+
// pointer, the value is ignored (and will cause an assertion failure in debug
|
1040
|
+
// mode.)
|
1002
1041
|
void RegisterMutexProfiler(void (*fn)(int64_t wait_cycles));
|
1003
1042
|
|
1004
1043
|
// Register a hook for Mutex tracing.
|
@@ -1011,13 +1050,11 @@ void RegisterMutexProfiler(void (*fn)(int64_t wait_cycles));
|
|
1011
1050
|
//
|
1012
1051
|
// The only event name currently sent is "slow release".
|
1013
1052
|
//
|
1014
|
-
// This has the same
|
1053
|
+
// This has the same ordering and single-use limitations as
|
1054
|
+
// RegisterMutexProfiler() above.
|
1015
1055
|
void RegisterMutexTracer(void (*fn)(const char *msg, const void *obj,
|
1016
1056
|
int64_t wait_cycles));
|
1017
1057
|
|
1018
|
-
// TODO(gfalcon): Combine RegisterMutexProfiler() and RegisterMutexTracer()
|
1019
|
-
// into a single interface, since they are only ever called in pairs.
|
1020
|
-
|
1021
1058
|
// Register a hook for CondVar tracing.
|
1022
1059
|
//
|
1023
1060
|
// The function pointer registered here will be called here on various CondVar
|
@@ -1028,7 +1065,8 @@ void RegisterMutexTracer(void (*fn)(const char *msg, const void *obj,
|
|
1028
1065
|
// Events that can be sent are "Wait", "Unwait", "Signal wakeup", and
|
1029
1066
|
// "SignalAll wakeup".
|
1030
1067
|
//
|
1031
|
-
// This has the same
|
1068
|
+
// This has the same ordering and single-use limitations as
|
1069
|
+
// RegisterMutexProfiler() above.
|
1032
1070
|
void RegisterCondVarTracer(void (*fn)(const char *msg, const void *cv));
|
1033
1071
|
|
1034
1072
|
// Register a hook for symbolizing stack traces in deadlock detector reports.
|
@@ -1038,7 +1076,8 @@ void RegisterCondVarTracer(void (*fn)(const char *msg, const void *cv));
|
|
1038
1076
|
// false if symbolizing failed, or true if a NUL-terminated symbol was written
|
1039
1077
|
// to 'out.'
|
1040
1078
|
//
|
1041
|
-
// This has the same
|
1079
|
+
// This has the same ordering and single-use limitations as
|
1080
|
+
// RegisterMutexProfiler() above.
|
1042
1081
|
//
|
1043
1082
|
// DEPRECATED: The default symbolizer function is absl::Symbolize() and the
|
1044
1083
|
// ability to register a different hook for symbolizing stack traces will be
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#include "absl/time/civil_time.h"
|
16
16
|
|
17
17
|
#include <cstdlib>
|
18
|
+
#include <ostream>
|
18
19
|
#include <string>
|
19
20
|
|
20
21
|
#include "absl/strings/str_cat.h"
|
@@ -167,6 +168,31 @@ std::ostream& operator<<(std::ostream& os, CivilSecond s) {
|
|
167
168
|
return os << FormatCivilTime(s);
|
168
169
|
}
|
169
170
|
|
171
|
+
bool AbslParseFlag(string_view s, CivilSecond* c, std::string*) {
|
172
|
+
return ParseLenientCivilTime(s, c);
|
173
|
+
}
|
174
|
+
bool AbslParseFlag(string_view s, CivilMinute* c, std::string*) {
|
175
|
+
return ParseLenientCivilTime(s, c);
|
176
|
+
}
|
177
|
+
bool AbslParseFlag(string_view s, CivilHour* c, std::string*) {
|
178
|
+
return ParseLenientCivilTime(s, c);
|
179
|
+
}
|
180
|
+
bool AbslParseFlag(string_view s, CivilDay* c, std::string*) {
|
181
|
+
return ParseLenientCivilTime(s, c);
|
182
|
+
}
|
183
|
+
bool AbslParseFlag(string_view s, CivilMonth* c, std::string*) {
|
184
|
+
return ParseLenientCivilTime(s, c);
|
185
|
+
}
|
186
|
+
bool AbslParseFlag(string_view s, CivilYear* c, std::string*) {
|
187
|
+
return ParseLenientCivilTime(s, c);
|
188
|
+
}
|
189
|
+
std::string AbslUnparseFlag(CivilSecond c) { return FormatCivilTime(c); }
|
190
|
+
std::string AbslUnparseFlag(CivilMinute c) { return FormatCivilTime(c); }
|
191
|
+
std::string AbslUnparseFlag(CivilHour c) { return FormatCivilTime(c); }
|
192
|
+
std::string AbslUnparseFlag(CivilDay c) { return FormatCivilTime(c); }
|
193
|
+
std::string AbslUnparseFlag(CivilMonth c) { return FormatCivilTime(c); }
|
194
|
+
std::string AbslUnparseFlag(CivilYear c) { return FormatCivilTime(c); }
|
195
|
+
|
170
196
|
} // namespace time_internal
|
171
197
|
|
172
198
|
ABSL_NAMESPACE_END
|