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

Side by Side Diff: runtime/vm/os_thread_macos.cc

Issue 2117593002: Fuchsia: Initial check-in. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 5 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
« no previous file with comments | « runtime/vm/os_thread_linux.cc ('k') | runtime/vm/os_thread_win.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" // NOLINT 5 #include "platform/globals.h" // NOLINT
6 #if defined(TARGET_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "vm/os_thread.h" 8 #include "vm/os_thread.h"
9 9
10 #include <sys/errno.h> // NOLINT 10 #include <sys/errno.h> // NOLINT
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 const int kStackSize = (128 * kWordSize * KB); 156 const int kStackSize = (128 * kWordSize * KB);
157 return kStackSize; 157 return kStackSize;
158 } 158 }
159 159
160 160
161 ThreadId OSThread::GetCurrentThreadId() { 161 ThreadId OSThread::GetCurrentThreadId() {
162 return pthread_self(); 162 return pthread_self();
163 } 163 }
164 164
165 165
166 #ifndef PRODUCT
166 ThreadId OSThread::GetCurrentThreadTraceId() { 167 ThreadId OSThread::GetCurrentThreadTraceId() {
167 return ThreadIdFromIntPtr(pthread_mach_thread_np(pthread_self())); 168 return ThreadIdFromIntPtr(pthread_mach_thread_np(pthread_self()));
168 } 169 }
170 #endif // PRODUCT
169 171
170 172
171 ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) { 173 ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
172 ASSERT(thread != NULL); 174 ASSERT(thread != NULL);
173 // Make sure we're filling in the join id for the current thread. 175 // Make sure we're filling in the join id for the current thread.
174 ASSERT(thread->id() == GetCurrentThreadId()); 176 ASSERT(thread->id() == GetCurrentThreadId());
175 // Make sure the join_id_ hasn't been set, yet. 177 // Make sure the join_id_ hasn't been set, yet.
176 DEBUG_ASSERT(thread->join_id_ == kInvalidThreadJoinId); 178 DEBUG_ASSERT(thread->join_id_ == kInvalidThreadJoinId);
177 pthread_t id = pthread_self(); 179 pthread_t id = pthread_self();
178 #if defined(DEBUG) 180 #if defined(DEBUG)
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 void Monitor::NotifyAll() { 421 void Monitor::NotifyAll() {
420 // When running with assertions enabled we track the owner. 422 // When running with assertions enabled we track the owner.
421 ASSERT(IsOwnedByCurrentThread()); 423 ASSERT(IsOwnedByCurrentThread());
422 int result = pthread_cond_broadcast(data_.cond()); 424 int result = pthread_cond_broadcast(data_.cond());
423 VALIDATE_PTHREAD_RESULT(result); 425 VALIDATE_PTHREAD_RESULT(result);
424 } 426 }
425 427
426 } // namespace dart 428 } // namespace dart
427 429
428 #endif // defined(TARGET_OS_MACOS) 430 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_linux.cc ('k') | runtime/vm/os_thread_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698