Support folly::getCurrentThreadID() without PThread
[folly.git] / folly / ThreadId.h
index db4decdb790327bbcfd24596c139cb2b1c2c791b..2a30ff784cc889195eeeba710d0e00424da564ef 100644 (file)
 
 #include <cstdint>
 
-#include <pthread.h>
+#include <folly/portability/PThread.h>
+#include <folly/portability/Windows.h>
 
 namespace folly {
 
 inline uint64_t getCurrentThreadID() {
 #ifdef _WIN32
-  // There's no need to force a Windows.h include, so grab the ID
-  // via pthread instead.
-  return uint64_t(pthread_getw32threadid_np(pthread_self()));
+  return uint64_t(GetCurrentThreadId());
 #else
   return uint64_t(pthread_self());
 #endif