Use folly::getCurrentThreadId() in SSLContext
[folly.git] / folly / io / async / SSLContext.cpp
index 630b34d26531a35635c3845e8ff4db6fd787c094..5550cdbb96ffa3200f81dbdd40ea2a0dd1189be3 100644 (file)
@@ -20,6 +20,7 @@
 #include <folly/Memory.h>
 #include <folly/Random.h>
 #include <folly/SpinLock.h>
+#include <folly/ThreadId.h>
 
 // ---------------------------------------------------------------------
 // SSLContext implementation
@@ -769,15 +770,7 @@ static void callbackLocking(int mode, int n, const char*, int) {
 }
 
 static unsigned long callbackThreadID() {
-  return static_cast<unsigned long>(
-#ifdef __APPLE__
-    pthread_mach_thread_np(pthread_self())
-#elif _MSC_VER
-    pthread_getw32threadid_np(pthread_self())
-#else
-    pthread_self()
-#endif
-  );
+  return static_cast<unsigned long>(folly::getCurrentThreadID());
 }
 
 static CRYPTO_dynlock_value* dyn_create(const char*, int) {