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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
7 | 7 |
8 #include "bin/thread.h" | 8 #include "bin/thread.h" |
9 #include "bin/thread_linux.h" | 9 #include "bin/thread_linux.h" |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 const int kStackSize = (128 * kWordSize * KB); | 149 const int kStackSize = (128 * kWordSize * KB); |
150 return kStackSize; | 150 return kStackSize; |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 ThreadId Thread::GetCurrentThreadId() { | 154 ThreadId Thread::GetCurrentThreadId() { |
155 return pthread_self(); | 155 return pthread_self(); |
156 } | 156 } |
157 | 157 |
158 | 158 |
159 bool Thread::Join(ThreadId id) { | |
160 return false; | |
161 } | |
162 | |
163 | |
164 intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { | 159 intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { |
165 ASSERT(sizeof(id) == sizeof(intptr_t)); | 160 ASSERT(sizeof(id) == sizeof(intptr_t)); |
166 return static_cast<intptr_t>(id); | 161 return static_cast<intptr_t>(id); |
167 } | 162 } |
168 | 163 |
169 | 164 |
170 bool Thread::Compare(ThreadId a, ThreadId b) { | 165 bool Thread::Compare(ThreadId a, ThreadId b) { |
171 return (pthread_equal(a, b) != 0); | 166 return (pthread_equal(a, b) != 0); |
172 } | 167 } |
173 | 168 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 void Monitor::NotifyAll() { | 328 void Monitor::NotifyAll() { |
334 // TODO(iposva): Do we need to track lock owners? | 329 // TODO(iposva): Do we need to track lock owners? |
335 int result = pthread_cond_broadcast(data_.cond()); | 330 int result = pthread_cond_broadcast(data_.cond()); |
336 VALIDATE_PTHREAD_RESULT(result); | 331 VALIDATE_PTHREAD_RESULT(result); |
337 } | 332 } |
338 | 333 |
339 } // namespace bin | 334 } // namespace bin |
340 } // namespace dart | 335 } // namespace dart |
341 | 336 |
342 #endif // defined(TARGET_OS_LINUX) | 337 #endif // defined(TARGET_OS_LINUX) |
OLD | NEW |