diff options
| author | 2012-03-30 19:50:04 -0700 | |
|---|---|---|
| committer | 2012-03-30 19:50:04 -0700 | |
| commit | d23f5206cf72ca3fb53ac3049649bb7d018232bf (patch) | |
| tree | 24005b3acfa8fb80a6e6d0403ecfe40ec2ceda2d /src | |
| parent | c1503430c715f9d71cf4297a186a9a3442f5b9ee (diff) | |
Another crack at implementing a usable GetTid() for Mac OS 10.5...
Change-Id: Ic607bc99fa665e81bbbaea1ea0bd1b35f26196ba
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils.cc b/src/utils.cc index 9a12b93d18..3751727780 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); |