Commit fe6ec8ef by Derek Mauro Committed by Copybara-Service

Only enable cordz on Linux with thread_local support

Fixes #1365

PiperOrigin-RevId: 503160321
Change-Id: I210f194373c3e08a75d68298a8482be5f1f2227c
parent 0a75e76b
......@@ -32,18 +32,10 @@ int32_t get_cordz_mean_interval();
// Sets the sample rate with the average interval between samples.
void set_cordz_mean_interval(int32_t mean_interval);
// Enable cordz unless any of the following applies:
// - no thread local support
// - MSVC build
// - Android build
// - Apple build
// - DLL build
// Hashtablez is turned off completely in opensource builds.
// MSVC's static atomics are dynamically initialized in debug mode, which breaks
// sampling.
#if defined(ABSL_HAVE_THREAD_LOCAL) && !defined(_MSC_VER) && \
!defined(ABSL_BUILD_DLL) && !defined(ABSL_CONSUME_DLL) && \
!defined(__ANDROID__) && !defined(__APPLE__)
// Cordz is only enabled on Linux with thread_local support.
#if defined(ABSL_INTERNAL_CORDZ_ENABLED)
#error ABSL_INTERNAL_CORDZ_ENABLED cannot be set directly
#elif defined(__linux__) && defined(ABSL_HAVE_THREAD_LOCAL)
#define ABSL_INTERNAL_CORDZ_ENABLED 1
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment