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

Unified Diff: runtime/platform/thread.h

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/bin/utils_macos.cc ('k') | runtime/platform/thread_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/thread.h
diff --git a/runtime/platform/thread.h b/runtime/platform/thread.h
index 02ad51e74d831ac63889e09da046a03e1451c3b7..fb56a505f4386c7ce9874f2462fbd10a77342829 100644
--- a/runtime/platform/thread.h
+++ b/runtime/platform/thread.h
@@ -25,6 +25,7 @@ namespace dart {
class Thread {
public:
static ThreadLocalKey kUnsetThreadLocalKey;
+ static ThreadId kInvalidThreadId;
typedef void (*ThreadStartFunction) (uword parameter);
@@ -41,6 +42,8 @@ class Thread {
static void SetThreadLocal(ThreadLocalKey key, uword value);
static intptr_t GetMaxStackSize();
static ThreadId GetCurrentThreadId();
+ static intptr_t ThreadIdToIntPtr(ThreadId id);
+ static bool Compare(ThreadId a, ThreadId b);
static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage);
};
@@ -91,58 +94,6 @@ class Monitor {
};
-class ScopedMutex {
- public:
- explicit ScopedMutex(Mutex* mutex) : mutex_(mutex) {
- ASSERT(mutex_ != NULL);
- mutex_->Lock();
- }
-
- ~ScopedMutex() {
- mutex_->Unlock();
- }
-
- private:
- Mutex* const mutex_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedMutex);
-};
-
-
-class ScopedMonitor {
- public:
- explicit ScopedMonitor(Monitor* monitor) : monitor_(monitor) {
- ASSERT(monitor_ != NULL);
- monitor_->Enter();
- }
-
- ~ScopedMonitor() {
- monitor_->Exit();
- }
-
- Monitor::WaitResult Wait(int64_t millis = dart::Monitor::kNoTimeout) {
- return monitor_->Wait(millis);
- }
-
- Monitor::WaitResult WaitMicros(int64_t micros = dart::Monitor::kNoTimeout) {
- return monitor_->WaitMicros(micros);
- }
-
- void Notify() {
- monitor_->Notify();
- }
-
- void NotifyAll() {
- monitor_->NotifyAll();
- }
-
- private:
- Monitor* const monitor_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedMonitor);
-};
-
-
} // namespace dart
« no previous file with comments | « runtime/bin/utils_macos.cc ('k') | runtime/platform/thread_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698