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 on_gce;
if (GPR_UNLIKELY(
!(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);
}
bool on_gce = g_gce_tenancy_checker();
g_is_on_gce.Store(on_gce, grpc_core::MemoryOrder::RELEASE);
return on_gce;
}

Loading…
Cancel
Save