aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/arena.h
diff options
context:
space:
mode:
authorGravatar Austin Schuh <austin@peloton-tech.com>2015-06-08 18:49:16 -0700
committerGravatar Austin Schuh <austin@peloton-tech.com>2015-06-08 18:49:16 -0700
commitfd73235f6b2534aa63af41359d9f386ade43a5cc (patch)
tree17eef748320d5e3ac728e12f04e88fa5fa301871 /src/google/protobuf/arena.h
parent9cbdaedb86debc56ffec91935ee9546f3c92eb0a (diff)
Refactored threadlocal logic.
Refactored the threadlocal logic for Android and IOS into logic in platform_macro.h which computes a GOOGLE_PROTOBUF_NO_THREADLOCAL define which is then used elsewhere. This allows new platforms without THREADLOCAL to be easily defined.
Diffstat (limited to 'src/google/protobuf/arena.h')
-rw-r--r--src/google/protobuf/arena.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h
index 6c3f606e..51149bae 100644
--- a/src/google/protobuf/arena.h
+++ b/src/google/protobuf/arena.h
@@ -39,6 +39,7 @@
#include <google/protobuf/stubs/atomic_sequence_num.h>
#include <google/protobuf/stubs/atomicops.h>
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/platform_macros.h>
#include <google/protobuf/stubs/type_traits.h>
namespace google {
@@ -528,7 +529,7 @@ class LIBPROTOBUF_EXPORT Arena {
// Thread local variables cannot be exposed through DLL interface but we can
// wrap them in static functions.
static ThreadCache& thread_cache();
-#elif defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE)
+#elif defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)
// Android ndk does not support GOOGLE_THREAD_LOCAL keyword so we use a custom thread
// local storage class we implemented.
// iOS also does not support the GOOGLE_THREAD_LOCAL keyword.