| 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 | 6 |
| 7 | 7 |
| 8 #if defined(TARGET_OS_ANDROID) | 8 #if defined(TARGET_OS_ANDROID) |
| 9 | 9 |
| 10 #include "vm/os_thread.h" | 10 #include "vm/os_thread.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 const int kStackSize = (128 * kWordSize * KB); | 181 const int kStackSize = (128 * kWordSize * KB); |
| 182 return kStackSize; | 182 return kStackSize; |
| 183 } | 183 } |
| 184 | 184 |
| 185 | 185 |
| 186 ThreadId OSThread::GetCurrentThreadId() { | 186 ThreadId OSThread::GetCurrentThreadId() { |
| 187 return gettid(); | 187 return gettid(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 | 190 |
| 191 #ifndef PRODUCT |
| 191 ThreadId OSThread::GetCurrentThreadTraceId() { | 192 ThreadId OSThread::GetCurrentThreadTraceId() { |
| 192 return GetCurrentThreadId(); | 193 return GetCurrentThreadId(); |
| 193 } | 194 } |
| 195 #endif // PRODUCT |
| 194 | 196 |
| 195 | 197 |
| 196 ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) { | 198 ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) { |
| 197 ASSERT(thread != NULL); | 199 ASSERT(thread != NULL); |
| 198 // Make sure we're filling in the join id for the current thread. | 200 // Make sure we're filling in the join id for the current thread. |
| 199 ASSERT(thread->id() == GetCurrentThreadId()); | 201 ASSERT(thread->id() == GetCurrentThreadId()); |
| 200 // Make sure the join_id_ hasn't been set, yet. | 202 // Make sure the join_id_ hasn't been set, yet. |
| 201 DEBUG_ASSERT(thread->join_id_ == kInvalidThreadJoinId); | 203 DEBUG_ASSERT(thread->join_id_ == kInvalidThreadJoinId); |
| 202 pthread_t id = pthread_self(); | 204 pthread_t id = pthread_self(); |
| 203 #if defined(DEBUG) | 205 #if defined(DEBUG) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 void Monitor::NotifyAll() { | 443 void Monitor::NotifyAll() { |
| 442 // When running with assertions enabled we track the owner. | 444 // When running with assertions enabled we track the owner. |
| 443 ASSERT(IsOwnedByCurrentThread()); | 445 ASSERT(IsOwnedByCurrentThread()); |
| 444 int result = pthread_cond_broadcast(data_.cond()); | 446 int result = pthread_cond_broadcast(data_.cond()); |
| 445 VALIDATE_PTHREAD_RESULT(result); | 447 VALIDATE_PTHREAD_RESULT(result); |
| 446 } | 448 } |
| 447 | 449 |
| 448 } // namespace dart | 450 } // namespace dart |
| 449 | 451 |
| 450 #endif // defined(TARGET_OS_ANDROID) | 452 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |