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

Unified Diff: runtime/vm/os_thread_macos.cc

Issue 796063006: Rename Thread -> OSThread. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months 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/vm/os_thread_macos.h ('k') | runtime/vm/os_thread_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_thread_macos.cc
===================================================================
--- runtime/vm/os_thread_macos.cc (revision 42873)
+++ runtime/vm/os_thread_macos.cc (working copy)
@@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#include "platform/globals.h"
+#include "platform/globals.h" // NOLINT
#if defined(TARGET_OS_MACOS)
-#include "vm/thread.h"
+#include "vm/os_thread.h"
#include <sys/errno.h> // NOLINT
#include <sys/types.h> // NOLINT
@@ -50,15 +50,15 @@
class ThreadStartData {
public:
- ThreadStartData(Thread::ThreadStartFunction function,
+ ThreadStartData(OSThread::ThreadStartFunction function,
uword parameter)
: function_(function), parameter_(parameter) {}
- Thread::ThreadStartFunction function() const { return function_; }
+ OSThread::ThreadStartFunction function() const { return function_; }
uword parameter() const { return parameter_; }
private:
- Thread::ThreadStartFunction function_;
+ OSThread::ThreadStartFunction function_;
uword parameter_;
DISALLOW_COPY_AND_ASSIGN(ThreadStartData);
@@ -71,7 +71,7 @@
static void* ThreadStart(void* data_ptr) {
ThreadStartData* data = reinterpret_cast<ThreadStartData*>(data_ptr);
- Thread::ThreadStartFunction function = data->function();
+ OSThread::ThreadStartFunction function = data->function();
uword parameter = data->parameter();
delete data;
@@ -82,7 +82,7 @@
}
-int Thread::Start(ThreadStartFunction function, uword parameter) {
+int OSThread::Start(ThreadStartFunction function, uword parameter) {
pthread_attr_t attr;
int result = pthread_attr_init(&attr);
RETURN_ON_PTHREAD_FAILURE(result);
@@ -90,7 +90,7 @@
result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
RETURN_ON_PTHREAD_FAILURE(result);
- result = pthread_attr_setstacksize(&attr, Thread::GetMaxStackSize());
+ result = pthread_attr_setstacksize(&attr, OSThread::GetMaxStackSize());
RETURN_ON_PTHREAD_FAILURE(result);
ThreadStartData* data = new ThreadStartData(function, parameter);
@@ -106,10 +106,11 @@
}
-ThreadLocalKey Thread::kUnsetThreadLocalKey = static_cast<pthread_key_t>(-1);
-ThreadId Thread::kInvalidThreadId = reinterpret_cast<ThreadId>(NULL);
+ThreadLocalKey OSThread::kUnsetThreadLocalKey =
+ static_cast<pthread_key_t>(-1);
+ThreadId OSThread::kInvalidThreadId = reinterpret_cast<ThreadId>(NULL);
-ThreadLocalKey Thread::CreateThreadLocal() {
+ThreadLocalKey OSThread::CreateThreadLocal() {
pthread_key_t key = kUnsetThreadLocalKey;
int result = pthread_key_create(&key, NULL);
VALIDATE_PTHREAD_RESULT(result);
@@ -118,7 +119,7 @@
}
-void Thread::DeleteThreadLocal(ThreadLocalKey key) {
+void OSThread::DeleteThreadLocal(ThreadLocalKey key) {
ASSERT(key != kUnsetThreadLocalKey);
int result = pthread_key_delete(key);
VALIDATE_PTHREAD_RESULT(result);
@@ -125,7 +126,7 @@
}
-void Thread::SetThreadLocal(ThreadLocalKey key, uword value) {
+void OSThread::SetThreadLocal(ThreadLocalKey key, uword value) {
ASSERT(key != kUnsetThreadLocalKey);
int result = pthread_setspecific(key, reinterpret_cast<void*>(value));
VALIDATE_PTHREAD_RESULT(result);
@@ -132,34 +133,34 @@
}
-intptr_t Thread::GetMaxStackSize() {
+intptr_t OSThread::GetMaxStackSize() {
const int kStackSize = (128 * kWordSize * KB);
return kStackSize;
}
-ThreadId Thread::GetCurrentThreadId() {
+ThreadId OSThread::GetCurrentThreadId() {
return pthread_self();
}
-bool Thread::Join(ThreadId id) {
+bool OSThread::Join(ThreadId id) {
return false;
}
-intptr_t Thread::ThreadIdToIntPtr(ThreadId id) {
+intptr_t OSThread::ThreadIdToIntPtr(ThreadId id) {
ASSERT(sizeof(id) == sizeof(intptr_t));
return reinterpret_cast<intptr_t>(id);
}
-bool Thread::Compare(ThreadId a, ThreadId b) {
+bool OSThread::Compare(ThreadId a, ThreadId b) {
return pthread_equal(a, b) != 0;
}
-void Thread::GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage) {
+void OSThread::GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage) {
ASSERT(thread_id == GetCurrentThreadId());
ASSERT(cpu_usage != NULL);
// TODO(johnmccutchan): Enable this after fixing issue with macos directory
« no previous file with comments | « runtime/vm/os_thread_macos.h ('k') | runtime/vm/os_thread_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698