From ad8d56ebc515843aa58a8ceae836996543d7ef6f Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 20 May 2022 09:39:12 +0200 Subject: use __thread instead of thread_local diff --git a/absl/strings/internal/cordz_functions.cc b/absl/strings/internal/cordz_functions.cc index 20d314f..b1e6cc3 100644 --- a/absl/strings/internal/cordz_functions.cc +++ b/absl/strings/internal/cordz_functions.cc @@ -40,7 +40,7 @@ std::atomic g_cordz_mean_interval(50000); // Special negative 'not initialized' per thread value for cordz_next_sample. static constexpr int64_t kInitCordzNextSample = -1; -ABSL_CONST_INIT thread_local int64_t cordz_next_sample = kInitCordzNextSample; +ABSL_CONST_INIT __thread int64_t cordz_next_sample = kInitCordzNextSample; // kIntervalIfDisabled is the number of profile-eligible events need to occur // before the code will confirm that cordz is still disabled. diff --git a/absl/strings/internal/cordz_functions.h b/absl/strings/internal/cordz_functions.h index ed108bf..c70d0e9 100644 --- a/absl/strings/internal/cordz_functions.h +++ b/absl/strings/internal/cordz_functions.h @@ -45,7 +45,7 @@ void set_cordz_mean_interval(int32_t mean_interval); // the value is 1 or less, the code will check on the next event if cordz is // enabled, and if so, will sample the Cord. cordz is only enabled when we can // use thread locals. -ABSL_CONST_INIT extern thread_local int64_t cordz_next_sample; +ABSL_CONST_INIT extern __thread int64_t cordz_next_sample; // Determines if the next sample should be profiled. If it is, the value pointed // at by next_sample will be set with the interval until the next sample. -- 2.37.3