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" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
7 | 7 |
8 #include "platform/thread.h" | 8 #include "platform/thread.h" |
9 | 9 |
10 #include <sys/errno.h> // NOLINT | 10 #include <sys/errno.h> // NOLINT |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 const int kStackSize = (128 * kWordSize * KB); | 135 const int kStackSize = (128 * kWordSize * KB); |
136 return kStackSize; | 136 return kStackSize; |
137 } | 137 } |
138 | 138 |
139 | 139 |
140 ThreadId Thread::GetCurrentThreadId() { | 140 ThreadId Thread::GetCurrentThreadId() { |
141 return pthread_self(); | 141 return pthread_self(); |
142 } | 142 } |
143 | 143 |
144 | 144 |
| 145 bool Thread::Join(ThreadId id) { |
| 146 return false; |
| 147 } |
| 148 |
| 149 |
145 intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { | 150 intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { |
146 ASSERT(sizeof(id) == sizeof(intptr_t)); | 151 ASSERT(sizeof(id) == sizeof(intptr_t)); |
147 return reinterpret_cast<intptr_t>(id); | 152 return reinterpret_cast<intptr_t>(id); |
148 } | 153 } |
149 | 154 |
150 | 155 |
151 bool Thread::Compare(ThreadId a, ThreadId b) { | 156 bool Thread::Compare(ThreadId a, ThreadId b) { |
152 return pthread_equal(a, b) != 0; | 157 return pthread_equal(a, b) != 0; |
153 } | 158 } |
154 | 159 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 322 |
318 void Monitor::NotifyAll() { | 323 void Monitor::NotifyAll() { |
319 // TODO(iposva): Do we need to track lock owners? | 324 // TODO(iposva): Do we need to track lock owners? |
320 int result = pthread_cond_broadcast(data_.cond()); | 325 int result = pthread_cond_broadcast(data_.cond()); |
321 VALIDATE_PTHREAD_RESULT(result); | 326 VALIDATE_PTHREAD_RESULT(result); |
322 } | 327 } |
323 | 328 |
324 } // namespace dart | 329 } // namespace dart |
325 | 330 |
326 #endif // defined(TARGET_OS_MACOS) | 331 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |