Chromium Code Reviews| Index: runtime/platform/thread_win.cc |
| diff --git a/runtime/platform/thread_win.cc b/runtime/platform/thread_win.cc |
| index e8be678cb6d0a1563aa38995f136ea9821cd4c91..72f22d7a407d9403bcaa1d0cc34b306c711f9ec4 100644 |
| --- a/runtime/platform/thread_win.cc |
| +++ b/runtime/platform/thread_win.cc |
| @@ -92,6 +92,17 @@ intptr_t Thread::GetMaxStackSize() { |
| } |
| +ThreadId Thread::GetCurrentThreadId() { |
| + return GetCurrentThread(); |
| +} |
| + |
| + |
| +void Thread::GetThreadCPUUsage(int64_t* cpu_usage) { |
| + ASSERT(cpu_usage != NULL); |
| + *cpu_usage = 0; |
|
siva
2013/10/28 05:19:21
UNIMPLEMENTED();
Cutch
2013/11/04 20:36:05
Done, but will be implemented soon.
|
| +} |
| + |
| + |
| void Thread::SetThreadLocal(ThreadLocalKey key, uword value) { |
| ASSERT(key != kUnsetThreadLocalKey); |
| BOOL result = TlsSetValue(key, reinterpret_cast<void*>(value)); |
| @@ -338,6 +349,19 @@ Monitor::WaitResult Monitor::Wait(int64_t millis) { |
| } |
| +Monitor::WaitResult Monitor::WaitMicros(int64_t micros) { |
| + // TODO(johnmccutchan): Investigate sub-millisecond sleep times on Windows. |
| + int64_t millis = micros / kMicrosecondsPerMillisecond; |
| + if ((millis * kMicrosecondsPerMillisecond) < micros) { |
| + // We've been asked to sleep for a fraction of a millisecond, |
| + // this isn't supported on Windows. Bumps milliseconds up by one |
| + // so that we never return too early. We likely return late though. |
| + millis += 1; |
| + } |
| + return Wait(millis); |
| +} |
| + |
| + |
| void Monitor::Notify() { |
| data_.SignalAndRemoveFirstWaiter(); |
| } |