summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Andy Getz <durandal@google.com>2022-08-31 13:15:21 -0400
committerGravatar GitHub <noreply@github.com>2022-08-31 13:15:21 -0400
commit8c0b94e793a66495e0b1f34a5eb26bd7dc672db0 (patch)
tree5685f426bc948eb01731ea946074f815711260cc
parent273292d1cfc0a94a65082ee350509af1d113344d (diff)
Switch time_state to explicit default initialization instead of value initialization. (#1261)20220623.1
It looks to me like the language rules treat these the same for this type, but evidently GCC feels differently. This only matters under TSAN where SpinLock has a non-trivial destructor, and under C++20 where ABSL_CONST_INIT is implemented (as constinit) by gcc. Fixes #1253 PiperOrigin-RevId: 469806751 Change-Id: Ic01b0142101f361bc19c95f9f9474e635669c58d
-rw-r--r--absl/base/config.h2
-rw-r--r--absl/time/clock.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/absl/base/config.h b/absl/base/config.h
index 8533aead..705ecea0 100644
--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -112,7 +112,7 @@
// LTS releases can be obtained from
// https://github.com/abseil/abseil-cpp/releases.
#define ABSL_LTS_RELEASE_VERSION 20220623
-#define ABSL_LTS_RELEASE_PATCH_LEVEL 0
+#define ABSL_LTS_RELEASE_PATCH_LEVEL 1
// Helper macro to convert a CPP variable to a string literal.
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x
diff --git a/absl/time/clock.cc b/absl/time/clock.cc
index 7b204c4e..a091efdc 100644
--- a/absl/time/clock.cc
+++ b/absl/time/clock.cc
@@ -196,7 +196,7 @@ struct ABSL_CACHELINE_ALIGNED TimeState {
absl::base_internal::SpinLock lock{absl::kConstInit,
base_internal::SCHEDULE_KERNEL_ONLY};
};
-ABSL_CONST_INIT static TimeState time_state{};
+ABSL_CONST_INIT static TimeState time_state;
// Return the time in ns as told by the kernel interface. Place in *cycleclock
// the value of the cycleclock at about the time of the syscall.