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

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

Issue 1368793002: Add OSThread::GetCurrentThreadTraceId and use it in the timeline implementation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 const int kStackSize = (128 * kWordSize * KB); 143 const int kStackSize = (128 * kWordSize * KB);
144 return kStackSize; 144 return kStackSize;
145 } 145 }
146 146
147 147
148 ThreadId OSThread::GetCurrentThreadId() { 148 ThreadId OSThread::GetCurrentThreadId() {
149 return pthread_self(); 149 return pthread_self();
150 } 150 }
151 151
152 152
153 ThreadId OSThread::GetCurrentThreadTraceId() {
154 return pthread_mach_thread_np(pthread_self());
155 }
156
157
153 ThreadJoinId OSThread::GetCurrentThreadJoinId() { 158 ThreadJoinId OSThread::GetCurrentThreadJoinId() {
154 return pthread_self(); 159 return pthread_self();
155 } 160 }
156 161
157 162
158 void OSThread::Join(ThreadJoinId id) { 163 void OSThread::Join(ThreadJoinId id) {
159 ASSERT(pthread_join(id, NULL) == 0); 164 ASSERT(pthread_join(id, NULL) == 0);
160 } 165 }
161 166
162 167
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 369
365 void Monitor::NotifyAll() { 370 void Monitor::NotifyAll() {
366 // TODO(iposva): Do we need to track lock owners? 371 // TODO(iposva): Do we need to track lock owners?
367 int result = pthread_cond_broadcast(data_.cond()); 372 int result = pthread_cond_broadcast(data_.cond());
368 VALIDATE_PTHREAD_RESULT(result); 373 VALIDATE_PTHREAD_RESULT(result);
369 } 374 }
370 375
371 } // namespace dart 376 } // namespace dart
372 377
373 #endif // defined(TARGET_OS_MACOS) 378 #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