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