Merge "libcutils: Fix thread ID on macOS"

This commit is contained in:
Treehugger Robot 2017-10-23 20:28:26 +00:00 committed by Gerrit Code Review
commit 6958506e82
2 changed files with 6 additions and 2 deletions

View File

@ -80,7 +80,9 @@ static thread_id GetThreadId() {
#if defined(__BIONIC__)
return gettid();
#elif defined(__APPLE__)
return syscall(SYS_thread_selfid);
uint64_t tid;
pthread_threadid_np(NULL, &tid);
return tid;
#elif defined(__linux__)
return syscall(__NR_gettid);
#elif defined(_WIN32)

View File

@ -35,7 +35,9 @@
#ifndef __ANDROID__
pid_t gettid() {
#if defined(__APPLE__)
return syscall(SYS_thread_selfid);
uint64_t tid;
pthread_threadid_np(NULL, &tid);
return tid;
#elif defined(__linux__)
return syscall(__NR_gettid);
#elif defined(_WIN32)