diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 17:19:40 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 21:02:08 +0100 |
commit | 34b14a8472f44f8517577756e033b92ebd4c5912 (patch) | |
tree | 66a0575156d0a17a835430137e218e2b3f04cc65 /src/corelib/thread/qthread_unix.cpp | |
parent | d34353a065c443aac20376cbd88323480d769183 (diff) | |
parent | edd555425a08f9e074f0a4d9333862636ccaae8d (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
examples/xml/htmlinfo/simpleexample.html
examples/xml/rsslisting/rsslisting.cpp
qmake/generators/win32/msbuild_objectmodel.cpp
src/3rdparty/harfbuzz-ng/src/hb-private.hh
src/corelib/global/qlogging.cpp
src/corelib/io/qstorageinfo_unix.cpp
src/corelib/thread/qwaitcondition_unix.cpp
src/gui/kernel/qguiapplication.cpp
src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
src/testlib/doc/src/qt-webpages.qdoc
tests/auto/other/qaccessibility/tst_qaccessibility.cpp
Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
Diffstat (limited to 'src/corelib/thread/qthread_unix.cpp')
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index f0ba7a7f07..996ed1779d 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -389,14 +389,13 @@ Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW int QThread::idealThreadCount() Q_DECL_NOTHROW { - int cores = -1; + int cores = 1; #if defined(Q_OS_HPUX) // HP-UX struct pst_dynamic psd; if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1) { perror("pstat_getdynamic"); - cores = -1; } else { cores = (int)psd.psd_proc_cnt; } @@ -408,7 +407,6 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW mib[1] = HW_NCPU; if (sysctl(mib, 2, &cores, &len, NULL, 0) != 0) { perror("sysctl"); - cores = -1; } #elif defined(Q_OS_IRIX) // IRIX @@ -443,9 +441,9 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW #else // the rest: Linux, Solaris, AIX, Tru64 cores = (int)sysconf(_SC_NPROCESSORS_ONLN); -#endif if (cores == -1) return 1; +#endif return cores; } |