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 @@
#include <cstdint>
#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
......
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