Index: runtime/platform/thread_android.cc |
diff --git a/runtime/platform/thread_android.cc b/runtime/platform/thread_android.cc |
index f29ffdb8e1fc06e8af9fb3207d9fbae0030526e5..ae68de6507a21f16cb7eb262fee783a4d99b339e 100644 |
--- a/runtime/platform/thread_android.cc |
+++ b/runtime/platform/thread_android.cc |
@@ -113,7 +113,7 @@ int Thread::Start(ThreadStartFunction function, uword parameter) { |
ThreadLocalKey Thread::kUnsetThreadLocalKey = static_cast<pthread_key_t>(-1); |
- |
+ThreadId Thread::kInvalidThreadId = static_cast<ThreadId>(0); |
ThreadLocalKey Thread::CreateThreadLocal() { |
pthread_key_t key = kUnsetThreadLocalKey; |
@@ -149,6 +149,17 @@ ThreadId Thread::GetCurrentThreadId() { |
} |
+intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { |
+ ASSERT(sizeof(id) == sizeof(intptr_t)); |
+ return static_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); |