Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2144)

Unified Diff: base/threading/thread_local.h

Issue 189263003: Switch thread_local to use ThreadPlatformStorage in Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.gypi ('k') | base/threading/thread_local_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_local.h
diff --git a/base/threading/thread_local.h b/base/threading/thread_local.h
index b13be1ab4678584d871147f928d6b839fe37e57d..df9c4b72573be242101b697fa6edcfd5445aeb78 100644
--- a/base/threading/thread_local.h
+++ b/base/threading/thread_local.h
@@ -26,6 +26,9 @@
// you must of course properly deal with safety and race conditions. This
// means a function-level static initializer is generally inappropiate.
//
+// In Android, the system TLS is limited, the implementation is backed with
+// ThreadLocalStorage.
+//
// Example usage:
// // My class is logically attached to a single thread. We cache a pointer
// // on the thread it was created on, so we can implement current().
@@ -50,6 +53,7 @@
#include "base/base_export.h"
#include "base/basictypes.h"
+#include "base/threading/thread_local_storage.h"
#if defined(OS_POSIX)
#include <pthread.h>
@@ -62,6 +66,8 @@ namespace internal {
struct BASE_EXPORT ThreadLocalPlatform {
#if defined(OS_WIN)
typedef unsigned long SlotType;
+#elif defined(OS_ANDROID)
+ typedef ThreadLocalStorage::StaticSlot SlotType;
#elif defined(OS_POSIX)
typedef pthread_key_t SlotType;
#endif
« no previous file with comments | « base/base.gypi ('k') | base/threading/thread_local_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698