diff --git a/kdecore/kernel/kthreadpool.cpp b/kdecore/kernel/kthreadpool.cpp index 1376dffb..46072736 100644 --- a/kdecore/kernel/kthreadpool.cpp +++ b/kdecore/kernel/kthreadpool.cpp @@ -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 diff --git a/kdecore/kernel/kthreadpool.h b/kdecore/kernel/kthreadpool.h index c9fe9b3f..9ca6c4a3 100644 --- a/kdecore/kernel/kthreadpool.h +++ b/kdecore/kernel/kthreadpool.h @@ -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; diff --git a/plasma/runnermanager.cpp b/plasma/runnermanager.cpp index 40d553fd..8b89fc65 100644 --- a/plasma/runnermanager.cpp +++ b/plasma/runnermanager.cpp @@ -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()