don't lower the number of threads if someone else has raised it higher already

svn path=/trunk/KDE/kdelibs/; revision=938756
This commit is contained in:
Aaron J. Seigo 2009-03-12 22:04:01 +00:00
parent a96782cd4b
commit 5ac8aefd50

View File

@ -87,7 +87,9 @@ public:
const int maxThreads = config.readEntry("maxThreads", 16);
const int numThreads = qMin(maxThreads, 2 + ((numProcs - 1) * 2));
//kDebug() << "setting up" << numThreads << "threads for" << numProcs << "processors";
Weaver::instance()->setMaximumNumberOfThreads(numThreads);
if (numThreads > Weaver::instance()->maximumNumberOfThreads()) {
Weaver::instance()->setMaximumNumberOfThreads(numThreads);
}
// Limit the number of instances of a single normal speed runner and all of the slow runners
// to half the number of threads
const int cap = qMax(2, numThreads/2);