From: Christopher Dykes Date: Fri, 14 Apr 2017 20:54:32 +0000 (-0700) Subject: Make folly::getCurrentThreadId() return a thread ID on OSX X-Git-Tag: v2017.04.17.00~7 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=9b2f7afe192834fdc4abc5687abc072bede25cd6 Make folly::getCurrentThreadId() return a thread ID on OSX Summary: It was previously returning a pointer masquerading as a `uint64_t`. Reviewed By: yfeldblum Differential Revision: D4888325 fbshipit-source-id: 6cf6ed09f0e7a39a8a2f93d3fa14b06913c27805 --- diff --git a/folly/ThreadId.h b/folly/ThreadId.h index 2a30ff78..6593b3f1 100644 --- a/folly/ThreadId.h +++ b/folly/ThreadId.h @@ -24,7 +24,9 @@ namespace folly { inline uint64_t getCurrentThreadID() { -#ifdef _WIN32 +#if __APPLE__ + return uint64_t(pthread_mach_thread_np(pthread_self())); +#elif _WIN32 return uint64_t(GetCurrentThreadId()); #else return uint64_t(pthread_self());