| 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return syscall(__NR_gettid); | 162 return syscall(__NR_gettid); |
| 163 } | 163 } |
| 164 | 164 |
| 165 | 165 |
| 166 ThreadJoinId OSThread::GetCurrentThreadJoinId() { | 166 ThreadJoinId OSThread::GetCurrentThreadJoinId() { |
| 167 return pthread_self(); | 167 return pthread_self(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 | 170 |
| 171 void OSThread::Join(ThreadJoinId id) { | 171 void OSThread::Join(ThreadJoinId id) { |
| 172 ASSERT(pthread_join(id, NULL) == 0); | 172 int result = pthread_join(id, NULL); |
| 173 ASSERT(result == 0); |
| 173 } | 174 } |
| 174 | 175 |
| 175 | 176 |
| 176 intptr_t OSThread::ThreadIdToIntPtr(ThreadId id) { | 177 intptr_t OSThread::ThreadIdToIntPtr(ThreadId id) { |
| 177 ASSERT(sizeof(id) == sizeof(intptr_t)); | 178 ASSERT(sizeof(id) == sizeof(intptr_t)); |
| 178 return static_cast<intptr_t>(id); | 179 return static_cast<intptr_t>(id); |
| 179 } | 180 } |
| 180 | 181 |
| 181 | 182 |
| 182 ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) { | 183 ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 365 |
| 365 void Monitor::NotifyAll() { | 366 void Monitor::NotifyAll() { |
| 366 // TODO(iposva): Do we need to track lock owners? | 367 // TODO(iposva): Do we need to track lock owners? |
| 367 int result = pthread_cond_broadcast(data_.cond()); | 368 int result = pthread_cond_broadcast(data_.cond()); |
| 368 VALIDATE_PTHREAD_RESULT(result); | 369 VALIDATE_PTHREAD_RESULT(result); |
| 369 } | 370 } |
| 370 | 371 |
| 371 } // namespace dart | 372 } // namespace dart |
| 372 | 373 |
| 373 #endif // defined(TARGET_OS_LINUX) | 374 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |