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

Unified Diff: runtime/platform/thread_linux.cc

Issue 109803002: Profiler Take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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_android.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_linux.cc
diff --git a/runtime/platform/thread_linux.cc b/runtime/platform/thread_linux.cc
index 36bcfe464573a75e893b59d85de3c74ba05915b2..12ea1f99df77554131e54e0381c83bad98f9589d 100644
--- a/runtime/platform/thread_linux.cc
+++ b/runtime/platform/thread_linux.cc
@@ -114,7 +114,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;
@@ -150,6 +150,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);
« no previous file with comments | « runtime/platform/thread_android.cc ('k') | runtime/platform/thread_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698