| 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_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 7 | 7 |
| 8 #include "vm/os_thread.h" | 8 #include "vm/os_thread.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 return GetCurrentThreadId(); | 160 return GetCurrentThreadId(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 | 163 |
| 164 ThreadJoinId OSThread::GetCurrentThreadJoinId() { | 164 ThreadJoinId OSThread::GetCurrentThreadJoinId() { |
| 165 return pthread_self(); | 165 return pthread_self(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 | 168 |
| 169 void OSThread::Join(ThreadJoinId id) { | 169 void OSThread::Join(ThreadJoinId id) { |
| 170 ASSERT(pthread_join(id, NULL) == 0); | 170 int result = pthread_join(id, NULL); |
| 171 ASSERT(result == 0); |
| 171 } | 172 } |
| 172 | 173 |
| 173 | 174 |
| 174 intptr_t OSThread::ThreadIdToIntPtr(ThreadId id) { | 175 intptr_t OSThread::ThreadIdToIntPtr(ThreadId id) { |
| 175 ASSERT(sizeof(id) == sizeof(intptr_t)); | 176 ASSERT(sizeof(id) == sizeof(intptr_t)); |
| 176 return static_cast<intptr_t>(id); | 177 return static_cast<intptr_t>(id); |
| 177 } | 178 } |
| 178 | 179 |
| 179 | 180 |
| 180 ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) { | 181 ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 360 |
| 360 void Monitor::NotifyAll() { | 361 void Monitor::NotifyAll() { |
| 361 // TODO(iposva): Do we need to track lock owners? | 362 // TODO(iposva): Do we need to track lock owners? |
| 362 int result = pthread_cond_broadcast(data_.cond()); | 363 int result = pthread_cond_broadcast(data_.cond()); |
| 363 VALIDATE_PTHREAD_RESULT(result); | 364 VALIDATE_PTHREAD_RESULT(result); |
| 364 } | 365 } |
| 365 | 366 |
| 366 } // namespace dart | 367 } // namespace dart |
| 367 | 368 |
| 368 #endif // defined(TARGET_OS_ANDROID) | 369 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |