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

Side by Side Diff: base/threading/platform_thread_posix.cc

Issue 7238021: Solaris patch (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixed some sysctl includes Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/third_party/nspr/prcpucfg_solaris.h ('k') | base/time_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sched.h> 8 #include <sched.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 PlatformThreadId PlatformThread::CurrentId() { 120 PlatformThreadId PlatformThread::CurrentId() {
121 // Pthreads doesn't have the concept of a thread ID, so we have to reach down 121 // Pthreads doesn't have the concept of a thread ID, so we have to reach down
122 // into the kernel. 122 // into the kernel.
123 #if defined(OS_MACOSX) 123 #if defined(OS_MACOSX)
124 return mach_thread_self(); 124 return mach_thread_self();
125 #elif defined(OS_LINUX) 125 #elif defined(OS_LINUX)
126 return syscall(__NR_gettid); 126 return syscall(__NR_gettid);
127 #elif defined(OS_FREEBSD) 127 #elif defined(OS_FREEBSD)
128 // TODO(BSD): find a better thread ID 128 // TODO(BSD): find a better thread ID
129 return reinterpret_cast<int64>(pthread_self()); 129 return reinterpret_cast<int64>(pthread_self());
130 #elif defined(OS_NACL) 130 #elif defined(OS_NACL) || defined(OS_SOLARIS)
131 return pthread_self(); 131 return pthread_self();
132 #endif 132 #endif
133 } 133 }
134 134
135 // static 135 // static
136 void PlatformThread::YieldCurrentThread() { 136 void PlatformThread::YieldCurrentThread() {
137 sched_yield(); 137 sched_yield();
138 } 138 }
139 139
140 // static 140 // static
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // Mac OS X uses lower-level mach APIs 226 // Mac OS X uses lower-level mach APIs
227 227
228 // static 228 // static
229 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) { 229 void PlatformThread::SetThreadPriority(PlatformThreadHandle, ThreadPriority) {
230 // TODO(crogers): implement 230 // TODO(crogers): implement
231 NOTIMPLEMENTED(); 231 NOTIMPLEMENTED();
232 } 232 }
233 #endif 233 #endif
234 234
235 } // namespace base 235 } // namespace base
OLDNEW
« no previous file with comments | « base/third_party/nspr/prcpucfg_solaris.h ('k') | base/time_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698