summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/thread.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp
index 5bf74140d50..1fd8bb047c8 100644
--- a/libcxx/src/thread.cpp
+++ b/libcxx/src/thread.cpp
@@ -23,6 +23,9 @@
#if defined(__NetBSD__)
#pragma weak pthread_create // Do not create libpthread dependency
#endif
+#if defined(_WIN32)
+#include <windows.h>
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -79,6 +82,10 @@ thread::hardware_concurrency() _NOEXCEPT
if (result < 0)
return 0;
return static_cast<unsigned>(result);
+#elif defined(_WIN32)
+ SYSTEM_INFO info;
+ GetSystemInfo(&info);
+ return info.dwNumberOfProcessors;
#else // defined(CTL_HW) && defined(HW_NCPU)
// TODO: grovel through /proc or check cpuid on x86 and similar
// instructions on other architectures.
OpenPOWER on IntegriCloud