Merge "libcutils: Fix thread ID on macOS"
am: 6958506e82
Change-Id: If328ec31ff2d52b0852fb8e2eb2e061564504586
This commit is contained in:
commit
bdee15ef71
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue