mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
[vm] Further make [os_]thread_absl.cc compatible with Mac.
TEST=ci, cbuild Change-Id: I0fa9c11bbe826f71494cc9f7c89caed4f3597629 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238161 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
05a6506c92
commit
c4e913c839
9 changed files with 15 additions and 9 deletions
|
@ -129,7 +129,7 @@ const char* CanonicalFunction(const char* func);
|
|||
#define API_TIMELINE_BEGIN_END(thread) \
|
||||
do { \
|
||||
} while (false)
|
||||
#endif // !PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
class Api : AllStatic {
|
||||
public:
|
||||
|
|
|
@ -253,7 +253,7 @@ class OSThread : public BaseThread {
|
|||
static void Cleanup();
|
||||
#ifdef SUPPORT_TIMELINE
|
||||
static ThreadId GetCurrentThreadTraceId();
|
||||
#endif // PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
static OSThread* GetOSThreadFromThread(ThreadState* thread);
|
||||
static void AddThreadToListLocked(OSThread* thread);
|
||||
static void RemoveThreadFromList(OSThread* thread);
|
||||
|
|
|
@ -219,9 +219,15 @@ ThreadId OSThread::GetCurrentThreadId() {
|
|||
|
||||
#ifdef SUPPORT_TIMELINE
|
||||
ThreadId OSThread::GetCurrentThreadTraceId() {
|
||||
#if defined(DART_HOST_OS_ANDROID)
|
||||
return GetCurrentThreadId();
|
||||
#elif defined(DART_HOST_OS_LINUX)
|
||||
return syscall(__NR_gettid);
|
||||
#elif defined(DART_HOST_OS_MACOS)
|
||||
return ThreadIdFromIntPtr(pthread_mach_thread_np(pthread_self()));
|
||||
#endif
|
||||
}
|
||||
#endif // PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
|
||||
ASSERT(thread != NULL);
|
||||
|
|
|
@ -215,7 +215,7 @@ ThreadId OSThread::GetCurrentThreadId() {
|
|||
ThreadId OSThread::GetCurrentThreadTraceId() {
|
||||
return GetCurrentThreadId();
|
||||
}
|
||||
#endif // PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
|
||||
ASSERT(thread != NULL);
|
||||
|
|
|
@ -170,7 +170,7 @@ ThreadId OSThread::GetCurrentThreadId() {
|
|||
ThreadId OSThread::GetCurrentThreadTraceId() {
|
||||
return pthread_self();
|
||||
}
|
||||
#endif // PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
|
||||
ASSERT(thread != NULL);
|
||||
|
|
|
@ -216,7 +216,7 @@ ThreadId OSThread::GetCurrentThreadId() {
|
|||
ThreadId OSThread::GetCurrentThreadTraceId() {
|
||||
return syscall(__NR_gettid);
|
||||
}
|
||||
#endif // PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
|
||||
ASSERT(thread != NULL);
|
||||
|
|
|
@ -194,7 +194,7 @@ ThreadId OSThread::GetCurrentThreadId() {
|
|||
ThreadId OSThread::GetCurrentThreadTraceId() {
|
||||
return ThreadIdFromIntPtr(pthread_mach_thread_np(pthread_self()));
|
||||
}
|
||||
#endif // PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
|
||||
ASSERT(thread != NULL);
|
||||
|
|
|
@ -133,7 +133,7 @@ ThreadId OSThread::GetCurrentThreadId() {
|
|||
ThreadId OSThread::GetCurrentThreadTraceId() {
|
||||
return ::GetCurrentThreadId();
|
||||
}
|
||||
#endif // PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
|
||||
ASSERT(thread != NULL);
|
||||
|
|
|
@ -547,7 +547,7 @@ class TimelineEvent {
|
|||
#define TIMELINE_DURATION(thread, stream, name)
|
||||
#define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, name, function)
|
||||
#define TIMELINE_FUNCTION_GC_DURATION(thread, name)
|
||||
#endif // !PRODUCT
|
||||
#endif // SUPPORT_TIMELINE
|
||||
|
||||
// See |TimelineBeginEndScope|.
|
||||
class TimelineEventScope : public StackResource {
|
||||
|
|
Loading…
Reference in a new issue