summaryrefslogtreecommitdiff
path: root/absl/base/internal/thread_identity.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-05-27 10:22:20 -0700
committerGravatar Dino Radaković <dinor@google.com>2021-05-27 18:34:59 +0000
commit0d5156018dd3d0d075cc14a0aa6078979c7a85d3 (patch)
tree3945b34fc8838ba453be4b9e936601c9cc13b35c /absl/base/internal/thread_identity.cc
parent18045c4e32cbe6217224f46261b9e2607d6e723d (diff)
Export of internal Abseil changes
-- cbd86b318ce206d1fe9eb001979b8d2efe57e5fa by Derek Mauro <dmauro@google.com>: Stop inlining `CurrentThreadIdentityIfPresent()` on Apple platforms In some build configurations the Apple linker rejects thread_local variables exposed in headers Fixes #954 Fixes #965 PiperOrigin-RevId: 375930997 GitOrigin-RevId: e34600e09f748b686d20a4f729ae914ebfd9e7bf Change-Id: I9fcd2f02bd6abdea3ed412217e1be18f2c7bf762
Diffstat (limited to 'absl/base/internal/thread_identity.cc')
-rw-r--r--absl/base/internal/thread_identity.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/absl/base/internal/thread_identity.cc b/absl/base/internal/thread_identity.cc
index 6ea010ed..9950e63a 100644
--- a/absl/base/internal/thread_identity.cc
+++ b/absl/base/internal/thread_identity.cc
@@ -120,10 +120,10 @@ void SetCurrentThreadIdentity(
ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11
// Please see the comment on `CurrentThreadIdentityIfPresent` in
-// thread_identity.h. Because DLLs cannot expose thread_local variables in
-// headers, we opt for the correct-but-slower option of placing the definition
-// of this function only in a translation unit inside DLL.
-#if defined(ABSL_BUILD_DLL) || defined(ABSL_CONSUME_DLL)
+// thread_identity.h. When we cannot expose thread_local variables in
+// headers, we opt for the correct-but-slower option of not inlining this
+// function.
+#ifndef ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT
ThreadIdentity* CurrentThreadIdentityIfPresent() { return thread_identity_ptr; }
#endif
#endif