Преглед изворни кода

Use portable GOOGLE_PROTOBUF_THREAD_LOCAL instead of __thread.

Change-Id: Iaa75f8333541bc378bea699e7f147c7f17b652ad
Jisi Liu пре 10 година
родитељ
комит
0a25cfe69d
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      src/google/protobuf/arena.cc
  2. 1 1
      src/google/protobuf/arena.h

+ 1 - 1
src/google/protobuf/arena.cc

@@ -44,7 +44,7 @@ Arena::ThreadCache& Arena::thread_cache() {
   return thread_cache_;
 }
 #else
-__thread Arena::ThreadCache Arena::thread_cache_ = { -1, NULL };
+GOOGLE_THREAD_LOCAL Arena::ThreadCache Arena::thread_cache_ = { -1, NULL };
 #endif
 
 void Arena::Init() {

+ 1 - 1
src/google/protobuf/arena.h

@@ -374,7 +374,7 @@ class LIBPROTOBUF_EXPORT Arena {
   // wrap them in static functions.
   static ThreadCache& thread_cache();
 #else
-  static __thread ThreadCache thread_cache_;
+  static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_;
   static ThreadCache& thread_cache() { return thread_cache_; }
 #endif