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

Unified Diff: runtime/platform/thread_macos.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_linux.cc ('k') | runtime/platform/thread_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/thread_macos.h
diff --git a/runtime/platform/thread_macos.h b/runtime/platform/thread_macos.h
index c2b30595c15188bbe1e4195650e7fd5108376280..ad185c4a3fdaf6c60294d8205d1717fadeb2746e 100644
--- a/runtime/platform/thread_macos.h
+++ b/runtime/platform/thread_macos.h
@@ -15,6 +15,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_linux.cc ('k') | runtime/platform/thread_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698