summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-03-30 19:50:04 -0700
committerElliott Hughes <enh@google.com>2012-03-30 19:50:04 -0700
commitd23f5206cf72ca3fb53ac3049649bb7d018232bf (patch)
tree24005b3acfa8fb80a6e6d0403ecfe40ec2ceda2d
parentc1503430c715f9d71cf4297a186a9a3442f5b9ee (diff)
downloadart-d23f5206cf72ca3fb53ac3049649bb7d018232bf.zip
art-d23f5206cf72ca3fb53ac3049649bb7d018232bf.tar.gz
art-d23f5206cf72ca3fb53ac3049649bb7d018232bf.tar.bz2
Another crack at implementing a usable GetTid() for Mac OS 10.5...
Change-Id: Ic607bc99fa665e81bbbaea1ea0bd1b35f26196ba
-rw-r--r--src/utils.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils.cc b/src/utils.cc
index 9a12b93..3751727 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -57,7 +57,9 @@ pid_t GetTid() {
return syscall(SYS_thread_selfid);
#elif defined(__APPLE__)
// On Mac OS 10.5 (which the build servers are still running) there was nothing usable.
- return getpid();
+ // We know we build 32-bit binaries and that the pthread_t is a pointer that uniquely identifies
+ // the calling thread.
+ return reinterpret_cast<pid_t>(pthread_self());
#else
// Neither bionic nor glibc exposes gettid(2).
return syscall(__NR_gettid);