OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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(HOST_OS_FUCHSIA) | 6 #if defined(HOST_OS_FUCHSIA) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 #include "vm/os_thread.h" | 9 #include "vm/os_thread.h" |
10 #include "vm/os_thread_fuchsia.h" | 10 #include "vm/os_thread_fuchsia.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return kStackSize; | 158 return kStackSize; |
159 } | 159 } |
160 | 160 |
161 | 161 |
162 ThreadId OSThread::GetCurrentThreadId() { | 162 ThreadId OSThread::GetCurrentThreadId() { |
163 mx_info_handle_basic_t info; | 163 mx_info_handle_basic_t info; |
164 mx_handle_t thread_handle = thrd_get_mx_handle(thrd_current()); | 164 mx_handle_t thread_handle = thrd_get_mx_handle(thrd_current()); |
165 mx_status_t status = | 165 mx_status_t status = |
166 mx_object_get_info(thread_handle, MX_INFO_HANDLE_BASIC, &info, | 166 mx_object_get_info(thread_handle, MX_INFO_HANDLE_BASIC, &info, |
167 sizeof(info), nullptr, nullptr); | 167 sizeof(info), nullptr, nullptr); |
168 if (status != NO_ERROR) { | 168 if (status != MX_OK) { |
169 FATAL1("Failed to get thread koid: %s\n", mx_status_get_string(status)); | 169 FATAL1("Failed to get thread koid: %s\n", mx_status_get_string(status)); |
170 } | 170 } |
171 return info.koid; | 171 return info.koid; |
172 } | 172 } |
173 | 173 |
174 | 174 |
175 #ifndef PRODUCT | 175 #ifndef PRODUCT |
176 ThreadId OSThread::GetCurrentThreadTraceId() { | 176 ThreadId OSThread::GetCurrentThreadTraceId() { |
177 return pthread_self(); | 177 return pthread_self(); |
178 } | 178 } |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 void Monitor::NotifyAll() { | 436 void Monitor::NotifyAll() { |
437 // When running with assertions enabled we track the owner. | 437 // When running with assertions enabled we track the owner. |
438 ASSERT(IsOwnedByCurrentThread()); | 438 ASSERT(IsOwnedByCurrentThread()); |
439 int result = pthread_cond_broadcast(data_.cond()); | 439 int result = pthread_cond_broadcast(data_.cond()); |
440 VALIDATE_PTHREAD_RESULT(result); | 440 VALIDATE_PTHREAD_RESULT(result); |
441 } | 441 } |
442 | 442 |
443 } // namespace dart | 443 } // namespace dart |
444 | 444 |
445 #endif // defined(HOST_OS_FUCHSIA) | 445 #endif // defined(HOST_OS_FUCHSIA) |
OLD | NEW |