Commit 0a25cfe6 authored by Jisi Liu's avatar Jisi Liu

Use portable GOOGLE_PROTOBUF_THREAD_LOCAL instead of __thread.

Change-Id: Iaa75f8333541bc378bea699e7f147c7f17b652ad
parent b25caa5c
...@@ -44,7 +44,7 @@ Arena::ThreadCache& Arena::thread_cache() { ...@@ -44,7 +44,7 @@ Arena::ThreadCache& Arena::thread_cache() {
return thread_cache_; return thread_cache_;
} }
#else #else
__thread Arena::ThreadCache Arena::thread_cache_ = { -1, NULL }; GOOGLE_THREAD_LOCAL Arena::ThreadCache Arena::thread_cache_ = { -1, NULL };
#endif #endif
void Arena::Init() { void Arena::Init() {
......
...@@ -374,7 +374,7 @@ class LIBPROTOBUF_EXPORT Arena { ...@@ -374,7 +374,7 @@ class LIBPROTOBUF_EXPORT Arena {
// wrap them in static functions. // wrap them in static functions.
static ThreadCache& thread_cache(); static ThreadCache& thread_cache();
#else #else
static __thread ThreadCache thread_cache_; static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_;
static ThreadCache& thread_cache() { return thread_cache_; } static ThreadCache& thread_cache() { return thread_cache_; }
#endif #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