OSDN Git Service

bionic has always had gettid.
authorElliott Hughes <enh@google.com>
Wed, 20 Aug 2014 22:00:04 +0000 (15:00 -0700)
committerElliott Hughes <enh@google.com>
Wed, 20 Aug 2014 22:00:04 +0000 (15:00 -0700)
dex2oat calls GetTid for every line it outputs via Message, which is why
this showed up so much in strace.

Bug: 17049821
Change-Id: Ib51c7f88410b291692874023902cf43f4b9a9d1c

runtime/utils.cc

index b55977b..4c52229 100644 (file)
@@ -66,8 +66,9 @@ pid_t GetTid() {
   uint64_t owner;
   CHECK_PTHREAD_CALL(pthread_threadid_np, (NULL, &owner), __FUNCTION__);  // Requires Mac OS 10.6
   return owner;
+#elif defined(__BIONIC__)
+  return gettid();
 #else
-  // Neither bionic nor glibc exposes gettid(2).
   return syscall(__NR_gettid);
 #endif
 }