Commit ee080728 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Support folly::getCurrentThreadID() without PThread

Summary: Just use the native Windows API call instead, as it gives the same result.

Reviewed By: yfeldblum

Differential Revision: D4887587

fbshipit-source-id: adbfd288bea425f1aff46d0685083807490f7f09
parent 214b26f3
...@@ -19,14 +19,13 @@ ...@@ -19,14 +19,13 @@
#include <cstdint> #include <cstdint>
#include <folly/portability/PThread.h> #include <folly/portability/PThread.h>
#include <folly/portability/Windows.h>
namespace folly { namespace folly {
inline uint64_t getCurrentThreadID() { inline uint64_t getCurrentThreadID() {
#ifdef _WIN32 #ifdef _WIN32
// There's no need to force a Windows.h include, so grab the ID return uint64_t(GetCurrentThreadId());
// via pthread instead.
return uint64_t(pthread_getw32threadid_np(pthread_self()));
#else #else
return uint64_t(pthread_self()); return uint64_t(pthread_self());
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment