diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-12-12 10:00:05 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-02-07 16:14:31 +0000 |
commit | c1f4286a5cbc1794fe7be5bdbbd6a0bf29ef84d4 (patch) | |
tree | a917ea5849adae483b6a1d4f3cb5f9446dc09bc1 | |
parent | de4f256d48145778ed56389f5e883c5994b34dd2 (diff) |
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 329caa02ba..a13f8ca215 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -100,6 +100,9 @@ #include <sys/neutrino.h> #endif +#if defined(Q_OS_WASM) +#include <emscripten/val.h> +#endif QT_BEGIN_NAMESPACE @@ -499,6 +502,8 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW // as of aug 2008 VxWorks < 6.6 only supports one single core CPU cores = 1; # endif +#elif defined(Q_OS_WASM) + cores = emscripten::val::global("navigator")["hardwareConcurrency"].as<int>(); #else // the rest: Linux, Solaris, AIX, Tru64 cores = (int)sysconf(_SC_NPROCESSORS_ONLN); |