Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bot] gRPC native source shallow sync #299

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gRPC-C++.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Pod::Spec.new do |s|
# build.
'USE_HEADERMAP' => 'NO',
'ALWAYS_SEARCH_USER_PATHS' => 'NO',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
}

s.libraries = 'c++'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Pod::Spec.new do |s|
'ALWAYS_SEARCH_USER_PATHS' => 'NO',
'GCC_PREPROCESSOR_DEFINITIONS' => '"$(inherited)" "COCOAPODS=1"',
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
}

s.default_subspecs = 'Interface', 'Implementation'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-ProtoRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ Pod::Spec.new do |s|
# This is needed by all pods that depend on gRPC-RxLibrary:
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
}
end
2 changes: 1 addition & 1 deletion gRPC-RxLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ Pod::Spec.new do |s|

s.pod_target_xcconfig = {
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
}
end
2 changes: 1 addition & 1 deletion gRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Pod::Spec.new do |s|
# This is needed by all pods that depend on gRPC-RxLibrary:
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
}

s.ios.deployment_target = '11.0'
Expand Down
2 changes: 2 additions & 0 deletions src/core/lib/promise/activity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ namespace grpc_core {
///////////////////////////////////////////////////////////////////////////////
// GLOBALS

#if !defined(_WIN32) || !defined(_DLL)
thread_local Activity* Activity::g_current_activity_{nullptr};
#endif

namespace promise_detail {

Expand Down
25 changes: 18 additions & 7 deletions src/core/lib/promise/activity.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class Activity : public Orphanable {
// locked
// - back up that assertion with a runtime check in debug builds (it's
// prohibitively expensive in non-debug builds)
static Activity* current() { return g_current_activity_; }
static Activity* current() { return current_ref(); }

// Produce an activity-owning Waker. The produced waker will keep the activity
// alive until it's awoken or dropped.
Expand All @@ -232,17 +232,16 @@ class Activity : public Orphanable {
protected:
// Check if this activity is the current activity executing on the current
// thread.
bool is_current() const { return this == g_current_activity_; }
bool is_current() const { return this == current(); }
// Check if there is an activity executing on the current thread.
static bool have_current() { return g_current_activity_ != nullptr; }
static bool have_current() { return current() != nullptr; }
// Set the current activity at construction, clean it up at destruction.
class ScopedActivity {
public:
explicit ScopedActivity(Activity* activity)
: prior_activity_(g_current_activity_) {
g_current_activity_ = activity;
explicit ScopedActivity(Activity* activity) : prior_activity_(current()) {
current_ref() = activity;
}
~ScopedActivity() { g_current_activity_ = prior_activity_; }
~ScopedActivity() { current_ref() = prior_activity_; }
ScopedActivity(const ScopedActivity&) = delete;
ScopedActivity& operator=(const ScopedActivity&) = delete;

Expand All @@ -251,9 +250,21 @@ class Activity : public Orphanable {
};

private:
static Activity*& current_ref() {
#if !defined(_WIN32) || !defined(_DLL)
return g_current_activity_;
#else
// Set during RunLoop to the Activity that's executing.
// Being set implies that mu_ is held.
static thread_local Activity* current_activity;
return current_activity;
#endif
}
#if !defined(_WIN32) || !defined(_DLL)
// Set during RunLoop to the Activity that's executing.
// Being set implies that mu_ is held.
static thread_local Activity* g_current_activity_;
#endif
};

// Owned pointer to one Activity.
Expand Down
2 changes: 0 additions & 2 deletions src/core/plugin_registry/grpc_plugin_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ extern void RegisterOutlierDetectionLbPolicy(
CoreConfiguration::Builder* builder);
extern void RegisterWeightedTargetLbPolicy(CoreConfiguration::Builder* builder);
extern void RegisterPickFirstLbPolicy(CoreConfiguration::Builder* builder);
extern void RegisterRingHashLbPolicy(CoreConfiguration::Builder* builder);
extern void RegisterRoundRobinLbPolicy(CoreConfiguration::Builder* builder);
extern void RegisterWeightedRoundRobinLbPolicy(
CoreConfiguration::Builder* builder);
Expand Down Expand Up @@ -103,7 +102,6 @@ void BuildCoreConfiguration(CoreConfiguration::Builder* builder) {
RegisterWeightedTargetLbPolicy(builder);
RegisterPickFirstLbPolicy(builder);
RegisterRoundRobinLbPolicy(builder);
RegisterRingHashLbPolicy(builder);
RegisterWeightedRoundRobinLbPolicy(builder);
BuildClientChannelConfiguration(builder);
SecurityRegisterHandshakerFactories(builder);
Expand Down
2 changes: 2 additions & 0 deletions src/core/plugin_registry/grpc_plugin_registry_extra.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern void RegisterCdsLbPolicy(CoreConfiguration::Builder* builder);
extern void RegisterXdsOverrideHostLbPolicy(
CoreConfiguration::Builder* builder);
extern void RegisterXdsWrrLocalityLbPolicy(CoreConfiguration::Builder* builder);
extern void RegisterRingHashLbPolicy(CoreConfiguration::Builder* builder);
extern void RegisterFileWatcherCertificateProvider(
CoreConfiguration::Builder* builder);
extern void RegisterXdsHttpProxyMapper(CoreConfiguration::Builder* builder);
Expand All @@ -59,6 +60,7 @@ void RegisterExtraFilters(CoreConfiguration::Builder* builder) {
RegisterCdsLbPolicy(builder);
RegisterXdsOverrideHostLbPolicy(builder);
RegisterXdsWrrLocalityLbPolicy(builder);
RegisterRingHashLbPolicy(builder);
RegisterFileWatcherCertificateProvider(builder);
RegisterXdsHttpProxyMapper(builder);
#endif
Expand Down