| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |