Stop double caching

pull/23203/head
Richard Belleville 5 years ago
parent ae9ce800b1
commit b45acf15d1
  1. 8
      src/core/lib/security/credentials/google_default/google_default_credentials.cc

@ -366,12 +366,8 @@ void grpc_flush_cached_google_default_credentials(void) {
} }
bool is_on_gce(void) { bool is_on_gce(void) {
bool on_gce; bool on_gce = g_gce_tenancy_checker();
if (GPR_UNLIKELY( g_is_on_gce.Store(on_gce, grpc_core::MemoryOrder::RELEASE);
!(on_gce = g_is_on_gce.Load(grpc_core::MemoryOrder::ACQUIRE)))) {
on_gce = g_gce_tenancy_checker();
g_is_on_gce.Store(on_gce, grpc_core::MemoryOrder::RELEASE);
}
return on_gce; return on_gce;
} }

Loading…
Cancel
Save