From 3c494d4e40a04a42d98d526a0773bbdf276b7291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81o=C5=9B?= Date: Wed, 22 May 2024 10:47:06 +0200 Subject: [PATCH] Drop checks for VxWorks 6.6 in QThread 1. VxWorks 6.* and older are not supported in Qt6 due to C++17 requirement (among multiple other issues). 2. `_WRS_VXWORKS_MAJOR` and `_WRS_VXWORKS_MINOR` are defined in header `version.h` on VxWorks 7, which is not included anywhere, causing `QThread::idealThreadCount()` to always return 1. As a consequence, instance of `QThreadPool` returned by `QThreadPool::globalInstance()` have always only 1 thread. This causes failure of `tst_QEventDispatcher::postEventFromThread` test case. To fix that, remove VxWorks version checking from qthread_unix.cpp. Pick-to: 6.7 Task-number: QTBUG-115777 Change-Id: I08ffc4acdb74d13dd822402407a71f5916603440 Reviewed-by: Thiago Macieira (cherry picked from commit 8fec93e9a7bf3f8cb80aafb1e2329d998552fbcc) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/thread/qthread_unix.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 44487a2cc2b..13b061d7c7e 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -43,11 +43,8 @@ # include #endif #ifdef Q_OS_VXWORKS -# if (_WRS_VXWORKS_MAJOR > 6) || ((_WRS_VXWORKS_MAJOR == 6) && (_WRS_VXWORKS_MINOR >= 6)) -# include -# include -# define QT_VXWORKS_HAS_CPUSET -# endif +# include +# include #endif #ifdef Q_OS_HPUX @@ -466,8 +463,6 @@ int QThread::idealThreadCount() noexcept // as of aug 2008 Integrity only supports one single core CPU cores = 1; #elif defined(Q_OS_VXWORKS) - // VxWorks -# if defined(QT_VXWORKS_HAS_CPUSET) cpuset_t cpus = vxCpuEnabledGet(); cores = 0; @@ -478,10 +473,6 @@ int QThread::idealThreadCount() noexcept cores++; } } -# else - // as of aug 2008 VxWorks < 6.6 only supports one single core CPU - cores = 1; -# endif #elif defined(Q_OS_WASM) cores = QThreadPrivate::idealThreadCount; #else