Index: runtime/platform/thread_macos.cc |
diff --git a/runtime/platform/thread_macos.cc b/runtime/platform/thread_macos.cc |
index c4167d43c4cacb843ef653195cb4e4fe25db18e5..01c5c8c9e2d0dbc597f834e95978ee73389bd211 100644 |
--- a/runtime/platform/thread_macos.cc |
+++ b/runtime/platform/thread_macos.cc |
@@ -106,7 +106,7 @@ int Thread::Start(ThreadStartFunction function, uword parameter) { |
ThreadLocalKey Thread::kUnsetThreadLocalKey = static_cast<pthread_key_t>(-1); |
- |
+ThreadId Thread::kInvalidThreadId = reinterpret_cast<ThreadId>(NULL); |
ThreadLocalKey Thread::CreateThreadLocal() { |
pthread_key_t key = kUnsetThreadLocalKey; |
@@ -142,6 +142,17 @@ ThreadId Thread::GetCurrentThreadId() { |
} |
+intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { |
+ ASSERT(sizeof(id) == sizeof(intptr_t)); |
+ return reinterpret_cast<intptr_t>(id); |
+} |
+ |
+ |
+bool Thread::Compare(ThreadId a, ThreadId b) { |
+ return pthread_equal(a, b) != 0; |
+} |
+ |
+ |
void Thread::GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage) { |
ASSERT(thread_id == GetCurrentThreadId()); |
ASSERT(cpu_usage != NULL); |