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 "bin/thread.h" | 8 #include "bin/thread.h" |
9 #include "bin/thread_macos.h" | 9 #include "bin/thread_macos.h" |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const int kStackSize = (128 * kWordSize * KB); | 141 const int kStackSize = (128 * kWordSize * KB); |
142 return kStackSize; | 142 return kStackSize; |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 ThreadId Thread::GetCurrentThreadId() { | 146 ThreadId Thread::GetCurrentThreadId() { |
147 return pthread_self(); | 147 return pthread_self(); |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 bool Thread::Join(ThreadId id) { | |
152 return false; | |
153 } | |
154 | |
155 | |
156 intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { | 151 intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { |
157 ASSERT(sizeof(id) == sizeof(intptr_t)); | 152 ASSERT(sizeof(id) == sizeof(intptr_t)); |
158 return reinterpret_cast<intptr_t>(id); | 153 return reinterpret_cast<intptr_t>(id); |
159 } | 154 } |
160 | 155 |
161 | 156 |
162 bool Thread::Compare(ThreadId a, ThreadId b) { | 157 bool Thread::Compare(ThreadId a, ThreadId b) { |
163 return (pthread_equal(a, b) != 0); | 158 return (pthread_equal(a, b) != 0); |
164 } | 159 } |
165 | 160 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 void Monitor::NotifyAll() { | 333 void Monitor::NotifyAll() { |
339 // TODO(iposva): Do we need to track lock owners? | 334 // TODO(iposva): Do we need to track lock owners? |
340 int result = pthread_cond_broadcast(data_.cond()); | 335 int result = pthread_cond_broadcast(data_.cond()); |
341 VALIDATE_PTHREAD_RESULT(result); | 336 VALIDATE_PTHREAD_RESULT(result); |
342 } | 337 } |
343 | 338 |
344 } // namespace bin | 339 } // namespace bin |
345 } // namespace dart | 340 } // namespace dart |
346 | 341 |
347 #endif // defined(TARGET_OS_MACOS) | 342 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |