| 77 | #endif |
| 78 | |
| 79 | static thread_id GetThreadId() { |
| 80 | #if defined(__BIONIC__) |
| 81 | return gettid(); |
| 82 | #elif defined(__APPLE__) |
| 83 | uint64_t tid; |
| 84 | pthread_threadid_np(NULL, &tid); |
| 85 | return tid; |
| 86 | #elif defined(__linux__) |
| 87 | return syscall(__NR_gettid); |
| 88 | #elif defined(_WIN32) |
| 89 | return GetCurrentThreadId(); |
| 90 | #endif |
| 91 | } |
| 92 | |
| 93 | namespace { |
| 94 | #if defined(__GLIBC__) |