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

Unified Diff: runtime/platform/thread_linux.h

Issue 9328042: Move the thread local functions to the Thread class in runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 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 | « runtime/platform/thread.h ('k') | runtime/platform/thread_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/thread_linux.h
diff --git a/runtime/platform/thread_linux.h b/runtime/platform/thread_linux.h
index a32c680b6d549fc9838c78467f96f36c517a2856..4b8c7d5d22e400188ce2c61e7b448d57e4921a0a 100644
--- a/runtime/platform/thread_linux.h
+++ b/runtime/platform/thread_linux.h
@@ -16,6 +16,26 @@
namespace dart {
+typedef pthread_key_t ThreadLocalKey;
+
+class ThreadInlineImpl {
+ private:
+ ThreadInlineImpl() {}
+ ~ThreadInlineImpl() {}
+
+ static uword GetThreadLocal(ThreadLocalKey key) {
+ static ThreadLocalKey kUnsetThreadLocalKey = static_cast<pthread_key_t>(-1);
+ ASSERT(key != kUnsetThreadLocalKey);
+ return reinterpret_cast<uword>(pthread_getspecific(key));
+ }
+
+ friend class Thread;
+
+ DISALLOW_ALLOCATION();
+ DISALLOW_COPY_AND_ASSIGN(ThreadInlineImpl);
+};
+
+
class MutexData {
private:
MutexData() {}
« no previous file with comments | « runtime/platform/thread.h ('k') | runtime/platform/thread_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698