plasma: remove redundant KThreadPool::setMaxThreadCount() call

KThreadPool uses the same value by default

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-18 06:40:49 +03:00
parent ecd57181ea
commit 632dd982df
3 changed files with 6 additions and 11 deletions

View file

@ -50,6 +50,7 @@ KThreadPoolPrivate::KThreadPoolPrivate(KThreadPool *_parent)
maxthreads(QThread::idealThreadCount()),
activethreadcount(0)
{
kDebug() << "threads limits is" << maxthreads;
}
void KThreadPoolPrivate::appendThread(QThread *thread)
@ -152,9 +153,10 @@ int KThreadPool::maxThreadCount() const
return d->maxthreads;
}
void KThreadPool::setMaxThreadCount(int count)
void KThreadPool::setMaxThreadCount(int maxthreads)
{
d->maxthreads = count;
d->maxthreads = maxthreads;
kDebug() << "limiting threads to" << maxthreads;
}
int KThreadPool::activeThreadCount() const

View file

@ -45,7 +45,7 @@ public:
void waitForDone(const int timeout = 30000);
int maxThreadCount() const;
void setMaxThreadCount(int count);
void setMaxThreadCount(int maxthreads);
int activeThreadCount() const;

View file

@ -165,7 +165,7 @@ public:
}
}
static QThread::Priority threadPriority(AbstractRunner::Priority priority)
static QThread::Priority threadPriority(const AbstractRunner::Priority priority)
{
switch (priority) {
case AbstractRunner::LowestPriority: {
@ -207,13 +207,6 @@ RunnerManager::RunnerManager(QObject *parent)
: QObject(parent),
d(new RunnerManagerPrivate(this))
{
int maxThreads = QThread::idealThreadCount();
if (maxThreads < 0) {
maxThreads = 4;
}
kDebug() << "limiting runner threads to" << maxThreads;
//This entry allows to define a hard upper limit independent of the number of processors.
d->threadPool->setMaxThreadCount(maxThreads);
}
RunnerManager::~RunnerManager()