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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return ThreadIdFromIntPtr(pthread_mach_thread_np(pthread_self())); | 154 return ThreadIdFromIntPtr(pthread_mach_thread_np(pthread_self())); |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 ThreadJoinId OSThread::GetCurrentThreadJoinId() { | 158 ThreadJoinId OSThread::GetCurrentThreadJoinId() { |
159 return pthread_self(); | 159 return pthread_self(); |
160 } | 160 } |
161 | 161 |
162 | 162 |
163 void OSThread::Join(ThreadJoinId id) { | 163 void OSThread::Join(ThreadJoinId id) { |
164 ASSERT(pthread_join(id, NULL) == 0); | 164 int result = pthread_join(id, NULL); |
| 165 ASSERT(result == 0); |
165 } | 166 } |
166 | 167 |
167 | 168 |
168 intptr_t OSThread::ThreadIdToIntPtr(ThreadId id) { | 169 intptr_t OSThread::ThreadIdToIntPtr(ThreadId id) { |
169 ASSERT(sizeof(id) == sizeof(intptr_t)); | 170 ASSERT(sizeof(id) == sizeof(intptr_t)); |
170 return reinterpret_cast<intptr_t>(id); | 171 return reinterpret_cast<intptr_t>(id); |
171 } | 172 } |
172 | 173 |
173 | 174 |
174 ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) { | 175 ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 370 |
370 void Monitor::NotifyAll() { | 371 void Monitor::NotifyAll() { |
371 // TODO(iposva): Do we need to track lock owners? | 372 // TODO(iposva): Do we need to track lock owners? |
372 int result = pthread_cond_broadcast(data_.cond()); | 373 int result = pthread_cond_broadcast(data_.cond()); |
373 VALIDATE_PTHREAD_RESULT(result); | 374 VALIDATE_PTHREAD_RESULT(result); |
374 } | 375 } |
375 | 376 |
376 } // namespace dart | 377 } // namespace dart |
377 | 378 |
378 #endif // defined(TARGET_OS_MACOS) | 379 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |